WARNING: proceeding, even though we could not create PATH aliases: Refusing to create helper binaries under temporary dir "/tmp" (codex_home: AbsolutePathBuf("/tmp/codex-home"))
Reading additional input from stdin...
{"type":"thread.started","thread_id":"01a13b98-27c5-7271-b72a-c06295cfce6e"}
{"type":"turn.started"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"I’ll trace both worker handlers from queue payload parsing through every MongoDB read/write, then patch tenant scoping and verify that authorization failures are contained at the per-message boundary."}}
{"type":"item.started","item":{"id":"item_1","type":"command_execution","command":"/bin/bash -lc \"pwd && rg --files -g '\"'!node_modules'\"' -g '\"'!vendor'\"' | sed -n '1,240p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_1","type":"command_execution","command":"/bin/bash -lc \"pwd && rg --files -g '\"'!node_modules'\"' -g '\"'!vendor'\"' | sed -n '1,240p'\"","aggregated_output":"/workspace\nvoice-synthsizer-job-handler/salutation/salutation_service.js\nvoice-synthsizer-job-handler/salutation/salutation_model.js\nvoice-synthsizer-job-handler/salutation/index.js\nvoice-synthsizer-job-handler/pm2-development.yml\nvoice-synthsizer-job-handler/recording/recording_model.js\nvoice-synthsizer-job-handler/recording/index.js\nvoice-synthsizer-job-handler/index.js\nvoice-synthsizer-job-handler/package.json\nvoice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\nvoice-synthsizer-job-handler/recording_salutation/index.js\nvoice-synthsizer-job-handler/pm2-production.yml\nvoice-synthsizer-job-handler/job/job_service.js\nvoice-synthsizer-job-handler/job/index.js\nvoice-synthsizer-job-handler/job/job_model.js\nvoice-synthsizer-job-handler/user_audio_profile/index.js\nrequirements.prod.gpu.txt\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\nrequirements.dev.local.txt\npackage.json\napp/services/s3/index.js\napp/services/s3/s3_service.js\napp/services/utils/index.js\napp/services/utils/deleteFile.js\napp/services/utils/logService.js\napp/services/utils/bugsnag.js\nvoice-cloning/train_config.py\napp/services/voice_cloning/voice_cloning_model.js\nvoice-cloning/score_models.py\nvoice-cloning/minimize_cloned_voice_model.py\nvoice-cloning/synthesize_speech.py\napp/services/voice_cloning/index.js\napp/services/voice_cloning/voice_cloning_service.js\nvoice-cloning/utils/transcription_utils.py\nvoice-cloning/utils/matching_utils.py\nvoice-cloning/utils/synthesize_utils.py\nvoice-cloning/utils/scoring_utils.py\nvoice-cloning/train_multispeaker_baseline_model.py\napp/services/sqs/index.js\napp/services/sqs/sqs_service.js\nrequirements.prod.cpu.txt\nvoice-cloning/clone_voice.py\nvoice-cloning-job-handler/pm2-development.yml\nvoice-cloning-job-handler/index.js\nvoice-cloning-job-handler/package.json\nvoice-cloning/assets/speaker_encoder_model/model_se.pth.tar\nvoice-cloning/assets/speaker_encoder_model/config_se.json\nvoice-cloning/assets/wgnd_2_0_unique_names_only.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\nvoice-cloning/assets/wgnd_2_0_sources.csv.gz\nvoice-cloning/prepare_datasets.py\nvoice-cloning/score_salutation.py\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nvoice-cloning-job-handler/voice_cloning/index.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nvoice-cloning-job-handler/pm2-production.yml\nvoice-cloning-job-handler/user_audio_profile/index.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\nrequirements.dev.txt\nrequirements.txt\nREADME.md\nvoice-cloning/score_cloned_voice.py\nvoice-cloning/docs/potion-voice-cloning_Installation_Guide.md\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_2","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,260p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_3","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,320p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_4","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"find|findOne|update|delete|save|create|findBy|aggregate|count|bulk|replace\\\" -g '*.js' .\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_2","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,260p' index.js\"","aggregated_output":"const fs = require('fs')\nconst https = require('https')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\n\nconst Bugsnag = require('@bugsnag/js')\nconst mongoose = require('mongoose')\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst voiceCloningService = require('./voice_cloning')\nconst userAudioProfileService = require('./user_audio_profile')\n\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nlet throttleMessageFetching = true\nconst APP_ENV = process.env.POTION_APP_ENV\n\nconst cloudFrontUrlProd = process.env.CLOUDFRONT_URL_PROD\nconst cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\nconst cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n\nconst updateUrl = (str, cloudFrontUrl) => {\n  const host = new URL(str).host\n  return str.replace(`https://${host}`, cloudFrontUrl)\n}\n\nfunction connectDB(dbUri, retryCount = 0) {\n  return new Promise((resolve, reject) => {\n    console.log('Connection Attempt : ', retryCount)\n    mongoose.set('strictQuery', true)\n    mongoose\n      .connect(dbUri)\n      .then((msg) => {\n        console.log('Connected to Mongo DB !')\n        resolve()\n      })\n      .catch((err) => {\n        console.log('Failed to connect dns mongo: ', err)\n        if (retryCount < 6) {\n          retryCount++\n          connectDB(dbUri, retryCount)\n        }\n      })\n  })\n}\n\nfunction execShellCommand(cmd, logPath) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while proccessing python command', error)\n        reject(error)\n      }\n      // console.log('Stdout --- ', stdout)\n      // console.log('Stderror --- ', stderr)\n      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n\n      resolve()\n    })\n  })\n}\n\nasync function getFile(waveUrl, path) {\n  return new Promise((resolve) => {\n    https.get(waveUrl, (res) => {\n      const writeStream = fs.createWriteStream(path)\n\n      res.pipe(writeStream)\n\n      writeStream.on('finish', () => {\n        writeStream.close()\n        resolve()\n      })\n    })\n  })\n}\n\nfunction pad(s) {\n  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n  return s\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        console.log('job===', job)\n\n        const { metadata, input, _id, userAudioProfileId } = job._doc\n        console.log('userAudioProfileId', userAudioProfileId)\n        console.log('_id', _id)\n        const { env } = job\n        console.log('env', env)\n\n        console.log('metadata------', metadata)\n        console.log('input', input)\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        const cloudFrontUrl =\n          env === 'production'\n            ? cloudFrontUrlProd\n            : env === 'staging'\n            ? cloudFrontUrlStaging\n            : cloudFrontUrlDev\n\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const { directoryName } = metadata\n          console.log('directoryName', directoryName)\n          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n          if (!fs.existsSync(logPath)) {\n            fs.mkdirSync(logPath, { recursive: true })\n          }\n          // update the db model to processing\n          await voiceCloningService.update({ _id, status: 'processing' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'processing',\n          })\n\n          // create directory for userid-useraudioprofileid if not exist\n          const rootPath = `/tmp/${directoryName}`\n          const wavePath = `${rootPath}/wav48/1`\n          if (!fs.existsSync(wavePath)) {\n            fs.mkdirSync(wavePath, { recursive: true })\n          }\n\n          const txtPath = `${rootPath}/txt/1`\n          if (!fs.existsSync(txtPath)) {\n            fs.mkdirSync(txtPath, { recursive: true })\n          }\n          // download the training data files and put it in respective directories\n          for (let index = 0; index < input.length; index++) {\n            const item = input[index]\n\n            const { waveUrl, originalText } = item\n            // download wave file\n            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n\n            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n\n            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n            await fs.promises.writeFile(txtFilePath, originalText)\n          }\n\n          const zipFileName = directoryName + '.tgz'\n\n          // /tmp/directoryName.tgz\n\n          await execShellCommand(\n            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n            logPath\n          )\n          console.log('ZIP created ', zipFileName)\n\n          // re-sample audio\n          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n          console.time(SAMPLING_LABEL)\n\n          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n\n          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n          console.log('samplingCommand ', samplingCommand)\n          const samplingResponse = await execShellCommand(\n            samplingCommand,\n            logPath\n          )\n          console.timeEnd(SAMPLING_LABEL)\n\n          // /mnt/efs/potion-voice/${env}/speakrs.pth\n          // /mnt/efs/potion-voice/${env}/txt\n          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n\n          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n\n          const resultsPath = outPath + '/results'\n\n          //update pth file for cloning\n          // clone the voice\n          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n          console.time(VOICE_CLONING_LABEL)\n          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n            outPath + '/speakers.pth'\n          } --output_path ${resultsPath}`\n\n          console.log('Training Model Command', trainingModelCommand)\n          const trainingResponse = await execShellCommand(\n            trainingModelCommand,\n            logPath\n          )\n\n          console.timeEnd(VOICE_CLONING_LABEL)\n\n          let generatedDirectoryName = ''\n          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n            if (file.includes('vits_potion_clone'))\n              // use output from above to get right path and directory name\n              generatedDirectoryName = file\n          })\n\n          // minimize cloning model\n          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n          console.time(VOICE_MINIMIZE_LABEL)\n          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n            resultsPath + '/' + generatedDirectoryName + '/'\n          } --voice_model_name checkpoint_365200.pth`\n\n          console.log(\n            'Minimize Cloning Model Command',\n            minimizeCloningModelCommand\n          )\n          const minimizeCloning = await execShellCommand(\n            minimizeCloningModelCommand,\n            logPath\n          )\n          console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n          // Add the  code to update location of generated model and status into DB\n          await voiceCloningService.update({ _id, status: 'completed' })\n\n          const training_model_path = {\n            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n          }\n\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'completed',\n            training_model_path,\n          })\n\n          // add code to put that model into S3\n          let keys = Object.keys(training_model_path)\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_3","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,320p' index.js\"","aggregated_output":"const fs = require('fs')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\nconst Bugsnag = require('@bugsnag/js')\nconst uuid = require('uuid').v4\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst userAudioProfileService = require('./user_audio_profile')\nconst recordingModel = require('./recording')\nconst recordingSalutationModel = require('./recording_salutation')\nconst jobService = require('./job')\nconst salutationService = require('./salutation')\nlet throttleMessageFetching = true\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nconst APP_ENV = process.env.POTION_APP_ENV\nconst mongoose = require('mongoose')\n\nfunction execShellCommand(cmd) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while processing python command', error)\n        reject(error)\n      }\n      console.log('Stdout --- ', stdout)\n      console.log('Std error --- ', stderr)\n      resolve(stdout || stderr)\n    })\n  })\n}\n\nfunction connectDB(dbUri, retryCount = 0) {\n  return new Promise((resolve, reject) => {\n    console.log('Connection Attempt : ', retryCount)\n    mongoose.set('strictQuery', true)\n    mongoose\n      .connect(dbUri)\n      .then((msg) => {\n        console.log('Connected to Mongo DB !')\n        resolve()\n      })\n      .catch((err) => {\n        console.log('Failed to connect dns mongo: ', err)\n        if (retryCount < 6) {\n          retryCount++\n          connectDB(dbUri, retryCount)\n        }\n      })\n  })\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const {\n            userAudioProfileId,\n            text,\n            firstName,\n            salutationId,\n            recordingId,\n            baseUrlForPotionAi,\n            env,\n          } = job\n\n          const DB_URI =\n            env === 'production'\n              ? mongoUriProd\n              : env === 'staging'\n              ? mongoUriStaging\n              : mongoUriDev\n\n          console.log('DB_URI ', DB_URI)\n          await connectDB(DB_URI)\n\n          // read the path for the training model for the this users audio profile\n\n          const userAudioProfile = await userAudioProfileService.find({\n            _id: userAudioProfileId,\n            status: 'completed',\n          })\n          if (userAudioProfile) {\n            const { training_model_path, userId } = userAudioProfile[0]\n            const {\n              voice_model_light_path,\n              voice_model_config_light_path,\n              voice_model_speakers_file_path, // name for speakers embeddings file path\n            } = training_model_path\n\n            const outputPath = `/tmp/${uuid()}/`\n            if (!fs.existsSync(outputPath)) {\n              fs.mkdirSync(outputPath, { recursive: true })\n            }\n\n            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n            console.log('AI_COMMAND ', AI_COMMAND)\n\n            const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n            console.time(SYNTHESIZE_AI_LABEL)\n            const aiResponse = await execShellCommand(AI_COMMAND)\n            console.timeEnd(SYNTHESIZE_AI_LABEL)\n\n            let generatedFileName = ''\n            fs.readdirSync(`${outputPath}`).forEach((file) => {\n              if (file.includes('sr48000.wav')) generatedFileName = file\n            })\n\n            // upload the file to s3\n            const uploadParams = {\n              filePath: `${outputPath}${generatedFileName}`,\n              bucket: `recordings-${env}`,\n              fileName: `${uuid()}_salutation_${firstName.replace(\n                '-',\n                '_'\n              )}.wav`,\n              contentType: 'audio/x-wav',\n              fileType: 'wav',\n            }\n            console.time('Time to Upload video on S3')\n            const greetingUploadResponse = await s3.upload(uploadParams)\n            console.timeEnd('Time to Upload video on S3')\n\n            // Create new entry with the s3 path to salutation collection for the user and its profile id\n            // upsert the salutation\n            await salutationService.updateOrCreate(\n              {\n                firstName: firstName,\n                salutationVideo: greetingUploadResponse,\n                userAudioProfileId,\n              },\n              userId\n            )\n            // update the dynamic recordings for the current dynamic video with salutation url\n            const salutationToUpdate = await recordingSalutationModel.findOne({\n              _id: salutationId,\n              deleted: false,\n            })\n\n            const recordingToUpdate = await recordingModel.findOne({\n              _id: recordingId,\n              deleted: false,\n            })\n\n            if (\n              salutationToUpdate &&\n              salutationToUpdate.deleted === false &&\n              recordingToUpdate\n            ) {\n              const jobsToInsert = []\n\n              await recordingSalutationModel.findOneAndUpdate(\n                {\n                  _id: salutationId,\n                },\n                {\n                  $set: {\n                    salutationVideo: greetingUploadResponse,\n                  },\n                }\n              )\n\n              const jobData = {\n                originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n                originalVideo:\n                  recordingToUpdate.originalVideoUrl ||\n                  recordingToUpdate.urls[0].url,\n                cropTimestamp: recordingToUpdate.cropTimestamp,\n                greetingClips: [greetingUploadResponse],\n                greetingObjects: [\n                  {\n                    greetingId: salutationToUpdate._id,\n                    firstName: firstName,\n                    videoUrl: greetingUploadResponse,\n                  },\n                ],\n                requestOrigin: baseUrlForPotionAi,\n                environment: env,\n                recordingId: recordingToUpdate._id,\n                salutation: salutationToUpdate._id,\n                dynamicVideoType: recordingToUpdate.dynamicVideoType,\n              }\n              jobsToInsert.push({\n                firstName,\n                recordingId: recordingToUpdate._id,\n                userId: recordingToUpdate.userId,\n                salutationId: salutationToUpdate._id,\n                metadata: jobData,\n              })\n\n              // create the job for the ai to create processing\n              if (jobsToInsert.length) {\n                await jobService.insertMany(jobsToInsert)\n              }\n            }\n\n            fs.unlinkSync(`${outputPath}${generatedFileName}`)\n            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n          } else {\n            Bugsnag.notify(\n              new Error(\n                `audio profile training model not found ` + JSON.stringify(job)\n              )\n            )\n\n            resolve() // to continue working on new jobs\n          }\n        } catch (error) {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while synthesizing audio', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_4","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"find|findOne|update|delete|save|create|findBy|aggregate|count|bulk|replace\\\" -g '*.js' .\"","aggregated_output":"./index.js:14:AWS.config.update({ region: 'us-west-2' })\n./index.js:26:const updateUrl = (str, cloudFrontUrl) => {\n./index.js:28:  return str.replace(`https://${host}`, cloudFrontUrl)\n./index.js:72:      const writeStream = fs.createWriteStream(path)\n./index.js:130:          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n./index.js:138:          // update the db model to processing\n./index.js:139:          await voiceCloningService.update({ _id, status: 'processing' })\n./index.js:140:          await userAudioProfileService.update({\n./index.js:145:          // create directory for userid-useraudioprofileid if not exist\n./index.js:164:            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n./index.js:178:          console.log('ZIP created ', zipFileName)\n./index.js:202:          //update pth file for cloning\n./index.js:242:          // Add the  code to update location of generated model and status into DB\n./index.js:243:          await voiceCloningService.update({ _id, status: 'completed' })\n./index.js:248:            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n./index.js:253:          await userAudioProfileService.update({\n./index.js:274:          await userAudioProfileService.update({\n./index.js:287:          // update the db to set status as error\n./index.js:288:          await voiceCloningService.update({ _id, status: 'error' })\n./index.js:289:          await userAudioProfileService.update({\n./user_audio_profile/user_audio_profile_model.js:19:      default: 'created',\n./user_audio_profile/user_audio_profile_model.js:29:    deleted: {\n./voice_cloning/voice_cloning_model.js:19:      default: 'created',\n./voice_cloning/voice_cloning_model.js:33:    deleted: {\n./voice_cloning/voice_cloning_service.js:3:const create = (VoiceCloningModel) => async (data) => {\n./voice_cloning/voice_cloning_service.js:6:    const savedModel = await newModel.save()\n./voice_cloning/voice_cloning_service.js:7:    return savedModel\n./voice_cloning/voice_cloning_service.js:11:      'ERROR - VOICE CLONING SERVICE > create',\n./voice_cloning/voice_cloning_service.js:34:    const foundModel = await VoiceCloningModel.findOne({\n./voice_cloning/voice_cloning_service.js:36:      deleted: false,\n./voice_cloning/voice_cloning_service.js:49:const find = (VoiceCloningModel) => async (filter) => {\n./voice_cloning/voice_cloning_service.js:51:    const foundModels = await VoiceCloningModel.find({\n./voice_cloning/voice_cloning_service.js:53:      deleted: false,\n./voice_cloning/voice_cloning_service.js:59:      'ERROR - VOICE CLONING SERVICE > find',\n./voice_cloning/voice_cloning_service.js:66:const update = (VoiceCloningModel) => async (data) => {\n./voice_cloning/voice_cloning_service.js:68:    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./voice_cloning/voice_cloning_service.js:76:    return updatedModel\n./voice_cloning/voice_cloning_service.js:80:      'ERROR - VOICE CLONING SERVICE > update',\n./voice_cloning/voice_cloning_service.js:89:    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./voice_cloning/voice_cloning_service.js:93:          deleted: true,\n./voice_cloning/voice_cloning_service.js:98:    return updatedModel\n./voice_cloning/voice_cloning_service.js:111:    const updatedModel = await VoiceCloningModel.updateMany(\n./voice_cloning/voice_cloning_service.js:115:          deleted: true,\n./voice_cloning/voice_cloning_service.js:120:    return updatedModel\n./voice_cloning/voice_cloning_service.js:133:    create: create(VoiceCloningModel),\n./voice_cloning/voice_cloning_service.js:138:    update: update(VoiceCloningModel),\n./voice_cloning/voice_cloning_service.js:139:    find: find(VoiceCloningModel),\n./user_audio_profile/user_audio_profile_service.js:3:const create = (UserAudioProfileModel) => async (data) => {\n./user_audio_profile/user_audio_profile_service.js:6:    const savedModel = await newModel.save()\n./user_audio_profile/user_audio_profile_service.js:7:    return savedModel\n./user_audio_profile/user_audio_profile_service.js:11:      'ERROR - USER AUDIO PROFILE SERVICE > create',\n./user_audio_profile/user_audio_profile_service.js:34:    const foundModel = await UserAudioProfileModel.findOne({\n./user_audio_profile/user_audio_profile_service.js:36:      deleted: false,\n./user_audio_profile/user_audio_profile_service.js:49:const find = (UserAudioProfileModel) => async (filter) => {\n./user_audio_profile/user_audio_profile_service.js:51:    const foundModels = await UserAudioProfileModel.find({\n./user_audio_profile/user_audio_profile_service.js:53:      deleted: false,\n./user_audio_profile/user_audio_profile_service.js:59:      'ERROR - USER AUDIO PROFILE SERVICE > find',\n./user_audio_profile/user_audio_profile_service.js:66:const update = (UserAudioProfileModel) => async (data) => {\n./user_audio_profile/user_audio_profile_service.js:68:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js:75:    return updatedModel\n./user_audio_profile/user_audio_profile_service.js:79:      'ERROR - USER AUDIO PROFILE SERVICE > update',\n./user_audio_profile/user_audio_profile_service.js:88:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js:92:          deleted: true,\n./user_audio_profile/user_audio_profile_service.js:97:    return updatedModel\n./user_audio_profile/user_audio_profile_service.js:110:    const updatedModel = await UserAudioProfileModel.updateMany(\n./user_audio_profile/user_audio_profile_service.js:114:          deleted: true,\n./user_audio_profile/user_audio_profile_service.js:119:    return updatedModel\n./user_audio_profile/user_audio_profile_service.js:132:    create: create(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js:137:    update: update(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js:138:    find: find(UserAudioProfileModel),\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_5","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"find|findOne|update|delete|save|create|findBy|aggregate|count|bulk|replace\\\" -g '*.js' .\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_5","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"find|findOne|update|delete|save|create|findBy|aggregate|count|bulk|replace\\\" -g '*.js' .\"","aggregated_output":"./salutation/salutation_service.js:1:const create = (Salutation) => async (salutationData, userId) => {\r\n./salutation/salutation_service.js:3:  const savedSalutation = await newSalutation.save()\r\n./salutation/salutation_service.js:4:  return savedSalutation\r\n./salutation/salutation_service.js:8:  const foundSalutation = await Salutation.findOne({\r\n./salutation/salutation_service.js:10:    deleted: false,\r\n./salutation/salutation_service.js:15:const find = (Salutation) => async (filter) => {\r\n./salutation/salutation_service.js:16:  const foundSalutations = await Salutation.find({\r\n./salutation/salutation_service.js:18:    deleted: false,\r\n./salutation/salutation_service.js:23:const update = (Salutation) => async (salutation, userId) => {\r\n./salutation/salutation_service.js:24:  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n./salutation/salutation_service.js:29:  return updatedSalutation\r\n./salutation/salutation_service.js:33:  const findQuery = salutation._id\r\n./salutation/salutation_service.js:37:  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n./salutation/salutation_service.js:38:    findQuery,\r\n./salutation/salutation_service.js:42:  return updatedSalutation\r\n./salutation/salutation_service.js:45:const updateOrCreate =\r\n./salutation/salutation_service.js:55:      return await update(Salutation)(salutation, userId)\r\n./salutation/salutation_service.js:57:      return await create(Salutation)(\r\n./salutation/salutation_service.js:65:  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n./salutation/salutation_service.js:69:        deleted: true,\r\n./salutation/salutation_service.js:74:  return updatedSalutation\r\n./salutation/salutation_service.js:79:    create: create(Salutation),\r\n./salutation/salutation_service.js:82:    update: update(Salutation),\r\n./salutation/salutation_service.js:83:    updateOrCreate: updateOrCreate(Salutation),\r\n./salutation/salutation_service.js:84:    find: find(Salutation),\r\n./salutation/salutation_model.js:34:    deleted: {\r\n./index.js:15:AWS.config.update({ region: 'us-west-2' })\n./index.js:72:          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n./index.js:96:          const userAudioProfile = await userAudioProfileService.find({\n./index.js:130:              fileName: `${uuid()}_salutation_${firstName.replace(\n./index.js:143:            await salutationService.updateOrCreate(\n./index.js:151:            // update the dynamic recordings for the current dynamic video with salutation url\n./index.js:152:            const salutationToUpdate = await recordingSalutationModel.findOne({\n./index.js:154:              deleted: false,\n./index.js:157:            const recordingToUpdate = await recordingModel.findOne({\n./index.js:159:              deleted: false,\n./index.js:164:              salutationToUpdate.deleted === false &&\n./index.js:169:              await recordingSalutationModel.findOneAndUpdate(\n./index.js:208:              // create the job for the ai to create processing\n./index.js:215:            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n./recording/recording_model.js:108:    deleted: {\n./recording/recording_model.js:259:          deleted: {\n./recording_salutation/recording_salutation_model.js:48:    deleted: {\r\n./job/job_service.js:3:const create = (Job) => async (jobData) => {\n./job/job_service.js:6:    const savedJob = await newJob.save()\n./job/job_service.js:7:    return savedJob\n./job/job_service.js:11:      'ERROR - JOB SERVICE > create',\n./job/job_service.js:34:    const foundJob = await Job.findOne({\n./job/job_service.js:36:      deleted: false,\n./job/job_service.js:49:const find = (Job) => async (filter) => {\n./job/job_service.js:51:    const foundJobs = await Job.find({\n./job/job_service.js:53:      deleted: false,\n./job/job_service.js:59:      'ERROR - JOB SERVICE > find',\n./job/job_service.js:66:const update = (Job) => async (job) => {\n./job/job_service.js:68:    const updatedJob = await Job.findOneAndUpdate({ _id: job._id }, job, {\n./job/job_service.js:71:    return updatedJob\n./job/job_service.js:75:      'ERROR - JOB SERVICE > update',\n./job/job_service.js:84:    const updatedJob = await Job.findOneAndUpdate(\n./job/job_service.js:88:          deleted: true,\n./job/job_service.js:93:    return updatedJob\n./job/job_service.js:106:    const updatedJob = await Job.updateMany(\n./job/job_service.js:110:          deleted: true,\n./job/job_service.js:115:    return updatedJob\n./job/job_service.js:128:    create: create(Job),\n./job/job_service.js:133:    update: update(Job),\n./job/job_service.js:134:    find: find(Job),\n./job/job_model.js:37:      default: 'created'\n./job/job_model.js:43:    deleted: {\n./user_audio_profile/user_audio_profile_model.js:19:      default: 'created',\n./user_audio_profile/user_audio_profile_model.js:29:    deleted: {\n./user_audio_profile/user_audio_profile_service.js:3:const create = (UserAudioProfileModel) => async (data) => {\n./user_audio_profile/user_audio_profile_service.js:6:    const savedModel = await newModel.save()\n./user_audio_profile/user_audio_profile_service.js:7:    return savedModel\n./user_audio_profile/user_audio_profile_service.js:11:      'ERROR - USER AUDIO PROFILE SERVICE > create',\n./user_audio_profile/user_audio_profile_service.js:34:    const foundModel = await UserAudioProfileModel.findOne({\n./user_audio_profile/user_audio_profile_service.js:36:      deleted: false\n./user_audio_profile/user_audio_profile_service.js:49:const find = (UserAudioProfileModel) => async (filter) => {\n./user_audio_profile/user_audio_profile_service.js:51:    const foundModels = await UserAudioProfileModel.find({\n./user_audio_profile/user_audio_profile_service.js:53:      deleted: false\n./user_audio_profile/user_audio_profile_service.js:59:      'ERROR - USER AUDIO PROFILE SERVICE > find',\n./user_audio_profile/user_audio_profile_service.js:66:const update = (UserAudioProfileModel) => async (data) => {\n./user_audio_profile/user_audio_profile_service.js:69:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js:76:    console.log('ua updatedModel', updatedModel)\n./user_audio_profile/user_audio_profile_service.js:77:    return updatedModel\n./user_audio_profile/user_audio_profile_service.js:81:      'ERROR - USER AUDIO PROFILE SERVICE > update',\n./user_audio_profile/user_audio_profile_service.js:90:    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js:94:          deleted: true\n./user_audio_profile/user_audio_profile_service.js:99:    return updatedModel\n./user_audio_profile/user_audio_profile_service.js:112:    const updatedModel = await UserAudioProfileModel.updateMany(\n./user_audio_profile/user_audio_profile_service.js:116:          deleted: true\n./user_audio_profile/user_audio_profile_service.js:121:    return updatedModel\n./user_audio_profile/user_audio_profile_service.js:134:    create: create(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js:139:    update: update(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js:140:    find: find(UserAudioProfileModel)\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_6","type":"command_execution","command":"/bin/bash -lc 'git status --short'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_6","type":"command_execution","command":"/bin/bash -lc 'git status --short'","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_7","type":"agent_message","text":"The unsafe paths are confirmed in both workers: cloning updates two collections by `_id` alone, while synthesis derives a tenant from the fetched profile and then reads/updates recording data by IDs alone. I’m now checking payload contracts and schemas so the queue-supplied `userId` becomes the authorization boundary consistently."}}
{"type":"item.started","item":{"id":"item_8","type":"command_execution","command":"/bin/bash -lc \"sed -n '240,380p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_8","type":"command_execution","command":"/bin/bash -lc \"sed -n '240,380p' index.js\"","aggregated_output":"          console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n          // Add the  code to update location of generated model and status into DB\n          await voiceCloningService.update({ _id, status: 'completed' })\n\n          const training_model_path = {\n            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n          }\n\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'completed',\n            training_model_path,\n          })\n\n          // add code to put that model into S3\n          let keys = Object.keys(training_model_path)\n\n          const training_model_s3_path = {}\n\n          for (let index = 0; index < keys.length; index++) {\n            const path = training_model_path[keys[index]]\n            const s3Path = await s3.upload({\n              filePath: path,\n              fileName: `${directoryName}/${path.split('/').pop()}`,\n              bucket: `potion-voice-users-training-model/${env}`,\n            })\n            training_model_s3_path[keys[index]] = s3Path\n          }\n          //  add S3 path to user audio profile model\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            training_model_s3_path,\n          })\n        } catch (error) {\n          console.log('error********************', error)\n          Bugsnag.notify(\n            new Error(\n              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n            )\n          )\n          Bugsnag.notify(error)\n\n          // update the db to set status as error\n          await voiceCloningService.update({ _id, status: 'error' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'error',\n          })\n\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while training voice clone', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  console.log('potion Voice Clone Process Started')\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_9","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"userAudioProfileId|salutationId|voiceCloning|SQS|sendMessage|synthesi|synths\\\" app voice-cloning-job-handler voice-synthsizer-job-handler README.md -g '*.js' -g '*.md'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_9","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"userAudioProfileId|salutationId|voiceCloning|SQS|sendMessage|synthesi|synths\\\" app voice-cloning-job-handler voice-synthsizer-job-handler README.md -g '*.js' -g '*.md'\"","aggregated_output":"voice-cloning-job-handler/index.js:11:const voiceCloningService = require('./voice_cloning')\nvoice-cloning-job-handler/index.js:15:const sqsQueueUrl = process.env.SQS_URL\nvoice-cloning-job-handler/index.js:93:      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\nvoice-cloning-job-handler/index.js:104:        const { metadata, input, _id, userAudioProfileId } = job._doc\nvoice-cloning-job-handler/index.js:105:        console.log('userAudioProfileId', userAudioProfileId)\nvoice-cloning-job-handler/index.js:130:          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\nvoice-cloning-job-handler/index.js:139:          await voiceCloningService.update({ _id, status: 'processing' })\nvoice-cloning-job-handler/index.js:141:            _id: userAudioProfileId,\nvoice-cloning-job-handler/index.js:243:          await voiceCloningService.update({ _id, status: 'completed' })\nvoice-cloning-job-handler/index.js:254:            _id: userAudioProfileId,\nvoice-cloning-job-handler/index.js:275:            _id: userAudioProfileId,\nvoice-cloning-job-handler/index.js:288:          await voiceCloningService.update({ _id, status: 'error' })\nvoice-cloning-job-handler/index.js:290:            _id: userAudioProfileId,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js:11:    userAudioProfileId: {\napp/services/voice_cloning/voice_cloning_model.js:11:    userAudioProfileId: {\nREADME.md:2:Potion's Text-to-Speech Service (multi-speaker baseline model training, voice cloning and speech synthesising)\napp/services/sqs/index.js:4:const sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\napp/services/sqs/sqs_service.js:3:const sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\napp/services/sqs/sqs_service.js:7:const fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\napp/services/sqs/sqs_service.js:17:          `ERROR in fetchJobFromSQS : `,\napp/services/sqs/sqs_service.js:27:const deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\napp/services/sqs/sqs_service.js:37:          `ERROR in sending delete request to AWS.SQS : `,\napp/services/sqs/sqs_service.js:42:          'Successfully sent delete request to AWS.SQS',\napp/services/sqs/sqs_service.js:51:const sendMessageToSQS = (sqsQueueUrl, message) => {\napp/services/sqs/sqs_service.js:61:    sqs.sendMessage(params, function (err, data) {\napp/services/sqs/sqs_service.js:65:          `ERROR in seding request to AWS.SQS : `,\napp/services/sqs/sqs_service.js:70:          'Successfully sent request to AWS.SQS',\napp/services/sqs/sqs_service.js:80:  fetchMessageFromSQS,\napp/services/sqs/sqs_service.js:81:  deleteMessageFromSQS,\napp/services/sqs/sqs_service.js:82:  sendMessageToSQS,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:47:  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:50:      userAudioProfileId,\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:58:        { firstName, salutationVideo, userAudioProfileId },\r\nvoice-synthsizer-job-handler/salutation/salutation_model.js:24:    userAudioProfileId: {\r\nvoice-synthsizer-job-handler/index.js:16:const sqsQueueUrl = process.env.SQS_URL\nvoice-synthsizer-job-handler/index.js:62:      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\nvoice-synthsizer-job-handler/index.js:72:          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\nvoice-synthsizer-job-handler/index.js:75:            userAudioProfileId,\nvoice-synthsizer-job-handler/index.js:78:            salutationId,\nvoice-synthsizer-job-handler/index.js:97:            _id: userAudioProfileId,\nvoice-synthsizer-job-handler/index.js:113:            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\nvoice-synthsizer-job-handler/index.js:147:                userAudioProfileId,\nvoice-synthsizer-job-handler/index.js:153:              _id: salutationId,\nvoice-synthsizer-job-handler/index.js:171:                  _id: salutationId,\nvoice-synthsizer-job-handler/index.js:204:                salutationId: salutationToUpdate._id,\nvoice-synthsizer-job-handler/index.js:226:          console.error('Error while synthesizing audio', { error })\nvoice-synthsizer-job-handler/index.js:228:            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\nvoice-synthsizer-job-handler/index.js:238:      console.error('Error while synthesizing audio', { error })\nvoice-synthsizer-job-handler/job/job_model.js:13:    salutationId: {\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_10","type":"command_execution","command":"/bin/bash -lc \"for f in voice_cloning/voice_cloning_service.js voice_cloning/voice_cloning_model.js user_audio_profile/user_audio_profile_service.js user_audio_profile/user_audio_profile_model.js voice_cloning/index.js user_audio_profile/index.js package.json; do sed -n '1,240p' \\\"\"'$f\"; done'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_10","type":"command_execution","command":"/bin/bash -lc \"for f in voice_cloning/voice_cloning_service.js voice_cloning/voice_cloning_model.js user_audio_profile/user_audio_profile_service.js user_audio_profile/user_audio_profile_model.js voice_cloning/index.js user_audio_profile/index.js package.json; do sed -n '1,240p' \\\"\"'$f\"; done'","aggregated_output":"const StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (VoiceCloningModel) => async (data) => {\n  try {\n    const newModel = new VoiceCloningModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (VoiceCloningModel) => async (data) => {\n  try {\n    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (VoiceCloningModel) => {\n  return {\n    create: create(VoiceCloningModel),\n    insertMany: insertMany(VoiceCloningModel),\n    read: read(VoiceCloningModel),\n    remove: remove(VoiceCloningModel),\n    removeMany: removeMany(VoiceCloningModel),\n    update: update(VoiceCloningModel),\n    find: find(VoiceCloningModel),\n  }\n}\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst VoiceCloningSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    userAudioProfileId: {\n      type: Schema.Types.ObjectId,\n      ref: 'UserAudioProfile',\n      required: true,\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    input: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (UserAudioProfileModel) => async (data) => {\n  try {\n    const newModel = new UserAudioProfileModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (UserAudioProfileModel) => async (data) => {\n  try {\n    const inserted = await UserAudioProfileModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModel = await UserAudioProfileModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModels = await UserAudioProfileModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (UserAudioProfileModel) => async (data) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (UserAudioProfileModel) => {\n  return {\n    create: create(UserAudioProfileModel),\n    insertMany: insertMany(UserAudioProfileModel),\n    read: read(UserAudioProfileModel),\n    remove: remove(UserAudioProfileModel),\n    removeMany: removeMany(UserAudioProfileModel),\n    update: update(UserAudioProfileModel),\n    find: find(UserAudioProfileModel),\n  }\n}\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst UserAudioProfileSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    name: {\n      type: String,\n      required: true,\n      default: '',\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    training_model_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model_s3_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\nconst VoiceCloning = require('./voice_cloning_model')\nconst VoiceCloningService = require('./voice_cloning_service')\n\nmodule.exports = VoiceCloningService(VoiceCloning)\nconst UserAudioProfile = require('./user_audio_profile_model')\nconst UserAudioProfileService = require('./user_audio_profile_service')\n\nmodule.exports = UserAudioProfileService(UserAudioProfile)\n{\n  \"name\": \"voice-cloning-job-handler\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice cloning jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n    \"deploy-staging\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.staging.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-staging.js\"\n  },\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"pm2\": \"^5.2.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_11","type":"command_execution","command":"/bin/bash -lc \"for f in user_audio_profile/user_audio_profile_service.js user_audio_profile/user_audio_profile_model.js salutation/salutation_service.js salutation/salutation_model.js recording_salutation/recording_salutation_model.js job/job_service.js job/job_model.js package.json; do sed -n '1,280p' \\\"\"'$f\"; done'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_11","type":"command_execution","command":"/bin/bash -lc \"for f in user_audio_profile/user_audio_profile_service.js user_audio_profile/user_audio_profile_model.js salutation/salutation_service.js salutation/salutation_model.js recording_salutation/recording_salutation_model.js job/job_service.js job/job_model.js package.json; do sed -n '1,280p' \\\"\"'$f\"; done'","aggregated_output":"const StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (UserAudioProfileModel) => async (data) => {\n  try {\n    const newModel = new UserAudioProfileModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (UserAudioProfileModel) => async (data) => {\n  try {\n    const inserted = await UserAudioProfileModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModel = await UserAudioProfileModel.findOne({\n      ...filter,\n      deleted: false\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const foundModels = await UserAudioProfileModel.find({\n      ...filter,\n      deleted: false\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (UserAudioProfileModel) => async (data) => {\n  console.log('ua data', data)\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true\n      }\n    )\n    console.log('ua updatedModel', updatedModel)\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true\n        }\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (UserAudioProfileModel) => async (filter) => {\n  try {\n    const updatedModel = await UserAudioProfileModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true\n        }\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (UserAudioProfileModel) => {\n  return {\n    create: create(UserAudioProfileModel),\n    insertMany: insertMany(UserAudioProfileModel),\n    read: read(UserAudioProfileModel),\n    remove: remove(UserAudioProfileModel),\n    removeMany: removeMany(UserAudioProfileModel),\n    update: update(UserAudioProfileModel),\n    find: find(UserAudioProfileModel)\n  }\n}\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst UserAudioProfileSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    name: {\n      type: String,\n      required: true,\n      default: '',\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    training_model_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model_s3_path: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('UserAudioProfile', UserAudioProfileSchema)\nconst create = (Salutation) => async (salutationData, userId) => {\r\n  const newSalutation = new Salutation({ ...salutationData, userId })\r\n  const savedSalutation = await newSalutation.save()\r\n  return savedSalutation\r\n}\r\n\r\nconst read = (Salutation) => async (filter) => {\r\n  const foundSalutation = await Salutation.findOne({\r\n    ...filter,\r\n    deleted: false,\r\n  })\r\n  return foundSalutation\r\n}\r\n\r\nconst find = (Salutation) => async (filter) => {\r\n  const foundSalutations = await Salutation.find({\r\n    ...filter,\r\n    deleted: false,\r\n  })\r\n  return foundSalutations\r\n}\r\n\r\nconst update = (Salutation) => async (salutation, userId) => {\r\n  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n    { _id: salutation._id, userId },\r\n    salutation,\r\n    { new: true }\r\n  )\r\n  return updatedSalutation\r\n}\r\n\r\nconst modify = (Salutation) => async (salutation) => {\r\n  const findQuery = salutation._id\r\n    ? { _id: salutation._id }\r\n    : { transcriptId: salutation.transcriptId }\r\n\r\n  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n    findQuery,\r\n    salutation,\r\n    { new: true }\r\n  )\r\n  return updatedSalutation\r\n}\r\n\r\nconst updateOrCreate =\r\n  (Salutation) =>\r\n  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\r\n    const salutation = await read(Salutation)({\r\n      firstName,\r\n      userAudioProfileId,\r\n      userId,\r\n    })\r\n    if (salutation) {\r\n      salutation.salutationVideo = salutationVideo\r\n      return await update(Salutation)(salutation, userId)\r\n    } else {\r\n      return await create(Salutation)(\r\n        { firstName, salutationVideo, userAudioProfileId },\r\n        userId\r\n      )\r\n    }\r\n  }\r\n\r\nconst remove = (Salutation) => async (filter, userId) => {\r\n  const updatedSalutation = await Salutation.findOneAndUpdate(\r\n    { ...filter, userId },\r\n    {\r\n      $set: {\r\n        deleted: true,\r\n      },\r\n    },\r\n    { new: true }\r\n  )\r\n  return updatedSalutation\r\n}\r\n\r\nmodule.exports = (Salutation) => {\r\n  return {\r\n    create: create(Salutation),\r\n    read: read(Salutation),\r\n    remove: remove(Salutation),\r\n    update: update(Salutation),\r\n    updateOrCreate: updateOrCreate(Salutation),\r\n    find: find(Salutation),\r\n    modify: modify(Salutation),\r\n  }\r\n}\r\nconst mongoose = require('mongoose')\r\nconst Schema = mongoose.Schema\r\nconst SalutationSchema = Schema(\r\n  {\r\n    userId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'User',\r\n      required: true\r\n    },\r\n    firstName: {\r\n      type: String,\r\n      required: false,\r\n      default: ''\r\n    },\r\n    salutationVideo: {\r\n      type: String,\r\n      default: null\r\n    },\r\n    transcriptId: {\r\n      type: String,\r\n      default: null,\r\n      required: false\r\n    },\r\n    userAudioProfileId: {\r\n      type: Schema.Types.ObjectId,\r\n      default: null,\r\n      required: false\r\n    },\r\n    transcriptObj: {\r\n      type: Object,\r\n      default: null,\r\n      required: false\r\n    },\r\n    deleted: {\r\n      type: Boolean,\r\n      default: false\r\n    }\r\n  },\r\n  {\r\n    timestamps: true\r\n  }\r\n)\r\n\r\nmodule.exports = mongoose.model('Salutations', SalutationSchema)\r\nconst mongoose = require('mongoose')\r\nconst Schema = mongoose.Schema\r\n\r\nconst RecordingSalutationSchema = Schema(\r\n  {\r\n    userId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'User',\r\n      required: true\r\n    },\r\n    masterRecordingId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'Recordings',\r\n      required: true\r\n    },\r\n    recordingId: {\r\n      type: Schema.Types.ObjectId,\r\n      ref: 'Recordings',\r\n      required: false\r\n    },\r\n    firstName: {\r\n      type: String,\r\n      required: false,\r\n      default: ''\r\n    },\r\n    salutationVideo: {\r\n      type: String,\r\n      default: null\r\n    },\r\n    salutationVideoProcessed: {\r\n      type: String,\r\n      default: null\r\n    },\r\n    screenRecordingProcessed: {\r\n      type: String\r\n    },\r\n    transcriptId: {\r\n      type: String\r\n    },\r\n    processed: {\r\n      type: Boolean,\r\n      default: false\r\n    },\r\n    inProgress: {\r\n      type: Boolean,\r\n      default: false\r\n    },\r\n    deleted: {\r\n      type: Boolean,\r\n      default: false\r\n    },\r\n    backgroundScreenUrl: {\r\n      type: String\r\n    },\r\n    backgroundScreenFileUrl: {\r\n      type: String\r\n    },\r\n    slug: {\r\n      type: String\r\n    },\r\n    status: {\r\n      type: String,\r\n      default: null\r\n    }\r\n  },\r\n  {\r\n    timestamps: true\r\n  }\r\n)\r\n\r\nconst RecordingSalutationModel = mongoose.model(\r\n  'recording_salutations',\r\n  RecordingSalutationSchema\r\n)\r\n\r\nmodule.exports = RecordingSalutationModel\r\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (Job) => async (jobData) => {\n  try {\n    const newJob = new Job({ ...jobData })\n    const savedJob = await newJob.save()\n    return savedJob\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (Job) => async (jobData) => {\n  try {\n    const inserted = await Job.insertMany(jobData)\n    return inserted\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (Job) => async (filter) => {\n  try {\n    const foundJob = await Job.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (Job) => async (filter) => {\n  try {\n    const foundJobs = await Job.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundJobs\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (Job) => async (job) => {\n  try {\n    const updatedJob = await Job.findOneAndUpdate({ _id: job._id }, job, {\n      new: true,\n    })\n    return updatedJob\n  } catch (error) {\n    const details = { job }\n    console.log(\n      'ERROR - JOB SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (Job) => async (filter) => {\n  try {\n    const updatedJob = await Job.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (Job) => async (filter) => {\n  try {\n    const updatedJob = await Job.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (Job) => {\n  return {\n    create: create(Job),\n    insertMany: insertMany(Job),\n    read: read(Job),\n    remove: remove(Job),\n    removeMany: removeMany(Job),\n    update: update(Job),\n    find: find(Job),\n  }\n}\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\nconst JobSchema = Schema(\n  {\n    recordingId: {\n      type: Schema.Types.ObjectId,\n      required: false\n    },\n    userId: {\n      type: Schema.Types.ObjectId,\n      required: false\n    },\n    salutationId: {\n      type: Schema.Types.ObjectId,\n      required: false\n    },\n    type: {\n      type: String,\n      required: false,\n      default: 'ai-job'\n    },\n    firstName: {\n      type: String,\n      default: ''\n    },\n    weight: {\n      type: Number,\n      default: 0\n    },\n    email: {\n      type: String,\n      default: ''\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created'\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false\n    }\n  },\n  {\n    timestamps: true\n  }\n)\n\nmodule.exports = mongoose.model('Job', JobSchema)\n{\n  \"name\": \"voice-synthesizer-job-handler\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice synthesizer jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"deploy-production\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.production.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-production.js\",\n    \"deploy-staging\": \"npx dotenv-cli -e ./app-scripts/env-aws-code-deploy/.env.staging.aws-code-deploy node ./app-scripts/deploy-scripts/deploy-staging.js\"\n  },\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_12","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,240p' package.json && find . -maxdepth 3 -type f \\\\( -name '*test*' -o -name '*spec*' \\\\) -print\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_12","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,240p' package.json && find . -maxdepth 3 -type f \\\\( -name '*test*' -o -name '*spec*' \\\\) -print\"","aggregated_output":"{\n  \"name\": \"potion-voice\",\n  \"version\": \"1.0.0\",\n  \"description\": \"This will handle the voice cloning jobs\",\n  \"main\": \"index.js\",\n  \"scripts\": {},\n  \"dependencies\": {\n    \"@bugsnag/js\": \"^7.3.5\",\n    \"aws-sdk\": \"^2.752.0\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mongoose\": \"^6.8.0\",\n    \"pm2\": \"^5.2.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"uuid\": \"^8.3.2\"\n  },\n  \"devDependencies\": {\n    \"aws-code-deploy\": \"^1.0.11\"\n  },\n  \"author\": \"potion Team\",\n  \"license\": \"ISC\"\n}\n./node_modules/proxy-from-env/test.js\n./node_modules/isarray/test.js\n./node_modules/iserror/test.js\n./node_modules/memory-pager/test.js\n./node_modules/sparse-bitfield/test.js\n./node_modules/module-details-from-path/test.js\n./node_modules/git-node-fs/test.js\n./node_modules/safer-buffer/tests.js\n./node_modules/pump/test-browser.js\n./node_modules/pump/test-node.js\n./node_modules/stackframe/stackframe-tests.ts\n./node_modules/aws-sdk/buildspec.yml\n./node_modules/url/test.js\n./voice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc 'git log --oneline -12'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_13","type":"command_execution","command":"/bin/bash -lc 'git log --oneline -12'","aggregated_output":"ed59a7a initial\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_14","type":"command_execution","command":"/bin/bash -lc 'git branch --show-current && git remote -v'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_14","type":"command_execution","command":"/bin/bash -lc 'git branch --show-current && git remote -v'","aggregated_output":"master\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_15","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,340p' recording/recording_model.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_15","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,340p' recording/recording_model.js\"","aggregated_output":"const mongoose = require('mongoose')\nconst Schema = mongoose.Schema\nconst RecordingSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    urls: [\n      new mongoose.Schema(\n        {\n          quality: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          url: {\n            type: String,\n            required: false,\n            default: '',\n          },\n        },\n        { _id: false }\n      ),\n    ],\n    faceVideoUrl: {\n      type: String,\n      required: false,\n      default: '',\n    },\n    title: {\n      type: String,\n      required: false,\n      default: '',\n    },\n    type: {\n      type: String,\n      required: false,\n      default: 'video/webm',\n    },\n    duration: {\n      type: String,\n      required: false,\n      default: '',\n    },\n    screenRecording: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n    uploadedRecording: {\n      type: Boolean,\n      required: false,\n      default: false,\n    },\n    ctaClickCount: {\n      type: Number,\n      default: 0,\n    },\n    previewThumbnails: [\n      new mongoose.Schema(\n        {\n          size: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          url: {\n            type: String,\n            required: false,\n            default: '',\n          },\n        },\n        { _id: false }\n      ),\n    ],\n    previewGifs: [\n      new mongoose.Schema(\n        {\n          size: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          url: {\n            type: String,\n            required: false,\n            default: '',\n          },\n        },\n        { _id: false }\n      ),\n    ],\n    previewGifsVersion: {\n      type: Number,\n      required: false,\n      default: 0,\n    },\n    videoInitialGifUrl: {\n      type: String,\n      require: false,\n    },\n    unfirlGifUrl: {\n      type: String,\n      require: false,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: '0',\n    },\n    subtitles: [\n      new mongoose.Schema({\n        kind: {\n          type: String,\n          required: true,\n          default: 'subtitles',\n        },\n        label: {\n          type: String,\n          required: true,\n          default: 'English',\n        },\n        srclang: {\n          type: String,\n          required: true,\n          default: 'en',\n        },\n        url: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        transcriptId: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        transcriptionPending: {\n          type: Boolean,\n          required: true,\n          default: true,\n        },\n        isDefault: {\n          type: Boolean,\n          required: true,\n          default: true,\n        },\n      }),\n    ],\n    views: [\n      new mongoose.Schema({\n        deviceId: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        startedAt: {\n          type: String,\n          required: false,\n          default: '',\n        },\n        viewedDuration: {\n          type: String,\n          required: false,\n          default: '',\n        },\n      }),\n    ],\n    draft: {\n      type: Boolean,\n      require: true,\n      default: true,\n    },\n    notified: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamic: {\n      type: Boolean,\n      require: false,\n    },\n    dynamicVideoProcessing: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamicVideoProcessingError: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamicVideoTemplate: {\n      type: Boolean,\n      require: false,\n      default: false,\n    },\n    dynamicVideoTemplateBackgroundUrl: {\n      type: String,\n    },\n    dynamicVideoTemplateGenerationStatus: {\n      type: String,\n      require: false,\n      default: '',\n    },\n    dynamicVideoType: {\n      type: String,\n      default: 'video',\n    },\n    templateRecordingId: {\n      type: Schema.Types.ObjectId,\n      default: null,\n    },\n    autoGenerated: {\n      type: Boolean,\n      require: false,\n    },\n    masterRecordingId: {\n      type: Schema.Types.ObjectId,\n      require: false,\n      ref: 'Recordings',\n      default: null,\n    },\n    dynamicRecordings: [\n      new mongoose.Schema(\n        {\n          recordingId: {\n            type: Schema.Types.ObjectId,\n          },\n          firstName: {\n            type: String,\n            required: false,\n            default: '',\n          },\n          salutationVideo: {\n            type: String,\n            default: null,\n          },\n          salutationVideoProcessed: {\n            type: String,\n            default: null,\n          },\n          screenRecordingProcessed: {\n            type: String,\n          },\n          transcriptId: {\n            type: String,\n          },\n          processed: {\n            type: Boolean,\n            default: false,\n          },\n          inProgress: {\n            type: Boolean,\n            default: false,\n          },\n          deleted: {\n            type: Boolean,\n            default: false,\n          },\n          backgroundScreenUrl: {\n            type: String,\n          },\n          backgroundScreenFileUrl: {\n            type: String,\n          },\n          slug: {\n            type: String,\n          },\n          status: {\n            type: String,\n            default: null,\n          },\n        },\n        {\n          timestamps: true,\n        }\n      ),\n    ],\n    masterSalutationVideoUrl: {\n      type: String,\n      default: null,\n    },\n    cropTimestamp: {\n      type: Number,\n      default: 0,\n    },\n    audioURL: {\n      type: String,\n      default: null,\n    },\n    videoLogoUrl: {\n      type: String,\n      default: null,\n    },\n    videoLogoUrls: [\n      new mongoose.Schema({\n        url: {\n          type: String,\n          default: null,\n        },\n        logoSetting: {\n          type: Schema.Types.Mixed,\n          default: null,\n        },\n      }),\n    ],\n    videoLogoSetting: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    muteVideo: {\n      type: String,\n      require: false,\n      default: 'no',\n    },\n    autoPlayVideo: {\n      type: String,\n      default: null,\n    },\n    flipVideo: {\n      type: String,\n      require: false,\n      default: null,\n    },\n    showVideoSubtitle: {\n      type: String,\n      require: false,\n      default: null,\n    },\n    backgroundChangeStatus: {\n      type: String,\n      default: null,\n    },\n    backgroundImageUrl: {\n      type: String,\n      require: false,\n      default: null,\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_16","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"voice-cloning|voice-synth|SQS_URL|sendMessageToSQS|_doc\\\" . -g '\"'!node_modules/**'\"' -g '\"'!*.py'\"'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_17","type":"command_execution","command":"/bin/bash -lc \"find . -maxdepth 3 -type f \\\\( -name '.eslintrc*' -o -name '.prettier*' -o -name 'jest.config*' -o -name 'package-lock.json' \\\\) -print\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_17","type":"command_execution","command":"/bin/bash -lc \"find . -maxdepth 3 -type f \\\\( -name '.eslintrc*' -o -name '.prettier*' -o -name 'jest.config*' -o -name 'package-lock.json' \\\\) -print\"","aggregated_output":"./package-lock.json\n./node_modules/function-bind/.eslintrc\n./node_modules/socks/.prettierrc.yaml\n./node_modules/proxy-from-env/.eslintrc\n./node_modules/continuation-local-storage/.eslintrc\n./node_modules/mongoose/.eslintrc.js\n./node_modules/smart-buffer/.prettierrc.yaml\n./node_modules/stack-generator/.eslintrc.yml\n./node_modules/resolve/.eslintrc\n./node_modules/vm2/.eslintrc.js\n./node_modules/mquery/.eslintrc.json\n./node_modules/stackframe/.eslintrc.yml\n./node_modules/is-core-module/.eslintrc\n./node_modules/supports-preserve-symlinks-flag/.eslintrc\n./voice-synthsizer-job-handler/package-lock.json\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_16","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"voice-cloning|voice-synth|SQS_URL|sendMessageToSQS|_doc\\\" . -g '\"'!node_modules/**'\"' -g '\"'!*.py'\"'\"","aggregated_output":"./voice-synthsizer-job-handler/pm2-development.yml:10:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-synthesizer-ai-staging.fifo'\n./voice-synthsizer-job-handler/index.js:16:const sqsQueueUrl = process.env.SQS_URL\n./voice-synthsizer-job-handler/index.js:113:            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n./voice-synthsizer-job-handler/package.json:2:  \"name\": \"voice-synthesizer-job-handler\",\n./voice-synthsizer-job-handler/pm2-production.yml:10:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-synthesizer-ai-production.fifo'\n./app/services/sqs/sqs_service.js:51:const sendMessageToSQS = (sqsQueueUrl, message) => {\n./app/services/sqs/sqs_service.js:82:  sendMessageToSQS,\n./voice-cloning-job-handler/pm2-development.yml:11:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-staging.fifo'\n./voice-cloning-job-handler/index.js:15:const sqsQueueUrl = process.env.SQS_URL\n./voice-cloning-job-handler/index.js:104:        const { metadata, input, _id, userAudioProfileId } = job._doc\n./voice-cloning-job-handler/index.js:186:          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n./voice-cloning-job-handler/index.js:206:          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n./voice-cloning-job-handler/index.js:228:          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n./voice-cloning-job-handler/package.json:2:  \"name\": \"voice-cloning-job-handler\",\n./voice-cloning-job-handler/pm2-production.yml:11:      SQS_URL: 'https://sqs.us-west-2.amazonaws.com/[REDACTED_AWS_ACCOUNT_1961]/potion-voice-clone-ai-production.fifo'\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:1:# potion-voice **voice-cloning** *Installation and Usage Guide*\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:291:    (potion-voice_venv) $ cd voice-cloning/\n./voice-cloning/docs/potion-voice-cloning_Installation_Guide.md:322:     > Found 44283 files in /home/[REDACTED_HOMEDIR_USERNAME_3]/work/potion-repos/potion-voice_venv/potion-voice/voice-cloning/results/datasets/VCTK-Corpus-0.92\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_18","type":"command_execution","command":"/bin/bash -lc 'git ls-files | wc -l && git ls-files'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_18","type":"command_execution","command":"/bin/bash -lc 'git ls-files | wc -l && git ls-files'","aggregated_output":"94\n.claude/settings.json\n.gitignore\n.styx_prs/pr_1.json\n.styx_prs/pr_10.json\n.styx_prs/pr_11.json\n.styx_prs/pr_12.json\n.styx_prs/pr_13.json\n.styx_prs/pr_14.json\n.styx_prs/pr_15.json\n.styx_prs/pr_16.json\n.styx_prs/pr_17.json\n.styx_prs/pr_18.json\n.styx_prs/pr_19.json\n.styx_prs/pr_2.json\n.styx_prs/pr_20.json\n.styx_prs/pr_21.json\n.styx_prs/pr_22.json\n.styx_prs/pr_23.json\n.styx_prs/pr_24.json\n.styx_prs/pr_25.json\n.styx_prs/pr_26.json\n.styx_prs/pr_27.json\n.styx_prs/pr_28.json\n.styx_prs/pr_3.json\n.styx_prs/pr_4.json\n.styx_prs/pr_5.json\n.styx_prs/pr_6.json\n.styx_prs/pr_7.json\n.styx_prs/pr_8.json\n.styx_prs/pr_9.json\nREADME.md\napp/services/s3/index.js\napp/services/s3/s3_service.js\napp/services/sqs/index.js\napp/services/sqs/sqs_service.js\napp/services/utils/bugsnag.js\napp/services/utils/deleteFile.js\napp/services/utils/index.js\napp/services/utils/logService.js\napp/services/voice_cloning/index.js\napp/services/voice_cloning/voice_cloning_model.js\napp/services/voice_cloning/voice_cloning_service.js\npackage.json\nrequirements.dev.local.txt\nrequirements.dev.txt\nrequirements.prod.cpu.txt\nrequirements.prod.gpu.txt\nrequirements.txt\nvoice-cloning-job-handler/index.js\nvoice-cloning-job-handler/package.json\nvoice-cloning-job-handler/pm2-development.yml\nvoice-cloning-job-handler/pm2-production.yml\nvoice-cloning-job-handler/user_audio_profile/index.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\nvoice-cloning-job-handler/voice_cloning/index.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nvoice-cloning/assets/speaker_encoder_model/config_se.json\nvoice-cloning/assets/speaker_encoder_model/model_se.pth.tar\nvoice-cloning/assets/wgnd_2_0_sources.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only.csv.gz\nvoice-cloning/assets/wgnd_2_0_unique_names_only_limited_special_chars.csv\nvoice-cloning/clone_voice.py\nvoice-cloning/docs/potion-voice-cloning_Installation_Guide.md\nvoice-cloning/minimize_cloned_voice_model.py\nvoice-cloning/prepare_datasets.py\nvoice-cloning/score_cloned_voice.py\nvoice-cloning/score_models.py\nvoice-cloning/score_salutation.py\nvoice-cloning/synthesize_speech.py\nvoice-cloning/train_config.py\nvoice-cloning/train_multispeaker_baseline_model.py\nvoice-cloning/utils/matching_utils.py\nvoice-cloning/utils/scoring_utils.py\nvoice-cloning/utils/synthesize_utils.py\nvoice-cloning/utils/transcription_utils.py\nvoice-synthsizer-job-handler/index.js\nvoice-synthsizer-job-handler/job/index.js\nvoice-synthsizer-job-handler/job/job_model.js\nvoice-synthsizer-job-handler/job/job_service.js\nvoice-synthsizer-job-handler/package.json\nvoice-synthsizer-job-handler/pm2-development.yml\nvoice-synthsizer-job-handler/pm2-production.yml\nvoice-synthsizer-job-handler/recording/index.js\nvoice-synthsizer-job-handler/recording/recording_model.js\nvoice-synthsizer-job-handler/recording_salutation/index.js\nvoice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\nvoice-synthsizer-job-handler/salutation/index.js\nvoice-synthsizer-job-handler/salutation/salutation_model.js\nvoice-synthsizer-job-handler/salutation/salutation_service.js\nvoice-synthsizer-job-handler/user_audio_profile/index.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_19","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"userId\\\" voice-cloning-job-handler voice-synthsizer-job-handler -g '*.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_19","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"userId\\\" voice-cloning-job-handler voice-synthsizer-job-handler -g '*.js'\"","aggregated_output":"voice-synthsizer-job-handler/salutation/salutation_service.js:1:const create = (Salutation) => async (salutationData, userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:2:  const newSalutation = new Salutation({ ...salutationData, userId })\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:23:const update = (Salutation) => async (salutation, userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:25:    { _id: salutation._id, userId },\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:47:  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:51:      userId,\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:55:      return await update(Salutation)(salutation, userId)\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:59:        userId\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:64:const remove = (Salutation) => async (filter, userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:66:    { ...filter, userId },\r\nvoice-cloning-job-handler/voice_cloning/voice_cloning_model.js:6:    userId: {\nvoice-synthsizer-job-handler/salutation/salutation_model.js:5:    userId: {\r\nvoice-synthsizer-job-handler/recording/recording_model.js:5:    userId: {\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js:6:    userId: {\nvoice-synthsizer-job-handler/index.js:101:            const { training_model_path, userId } = userAudioProfile[0]\nvoice-synthsizer-job-handler/index.js:149:              userId\nvoice-synthsizer-job-handler/index.js:203:                userId: recordingToUpdate.userId,\nvoice-synthsizer-job-handler/job/job_model.js:9:    userId: {\nvoice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js:6:    userId: {\r\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js:6:    userId: {\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_20","type":"command_execution","command":"/bin/bash -lc \"for f in app/services/voice_cloning/*.js app/services/sqs/*.js; do sed -n '1,280p' \\\"\"'$f\"; done'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_20","type":"command_execution","command":"/bin/bash -lc \"for f in app/services/voice_cloning/*.js app/services/sqs/*.js; do sed -n '1,280p' \\\"\"'$f\"; done'","aggregated_output":"const VoiceCloning = require('./voice_cloning_model')\nconst VoiceCloningService = require('./voice_cloning_service')\n\nmodule.exports = VoiceCloningService(VoiceCloning)\nconst mongoose = require('mongoose')\nconst Schema = mongoose.Schema\n\nconst VoiceCloningSchema = Schema(\n  {\n    userId: {\n      type: Schema.Types.ObjectId,\n      ref: 'User',\n      required: true,\n    },\n    userAudioProfileId: {\n      type: Schema.Types.ObjectId,\n      ref: 'UserAudioProfile',\n      required: true,\n    },\n    status: {\n      type: String,\n      required: false,\n      default: 'created',\n    },\n    input: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    training_model: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    metadata: {\n      type: Schema.Types.Mixed,\n      default: null,\n    },\n    deleted: {\n      type: Boolean,\n      required: true,\n      default: false,\n    },\n  },\n  {\n    timestamps: true,\n  }\n)\n\nmodule.exports = mongoose.model('VoiceCloning', VoiceCloningSchema)\nconst StringifyUtils = require('../utils/logService')\n\nconst create = (VoiceCloningModel) => async (data) => {\n  try {\n    const newModel = new VoiceCloningModel({ ...data })\n    const savedModel = await newModel.save()\n    return savedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (VoiceCloningModel) => async (data) => {\n  try {\n    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (VoiceCloningModel) => async (filter) => {\n  try {\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id: data._id },\n      data,\n      {\n        new: true,\n      }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (VoiceCloningModel) => async (filter) => {\n  try {\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (VoiceCloningModel) => {\n  return {\n    create: create(VoiceCloningModel),\n    insertMany: insertMany(VoiceCloningModel),\n    read: read(VoiceCloningModel),\n    remove: remove(VoiceCloningModel),\n    removeMany: removeMany(VoiceCloningModel),\n    update: update(VoiceCloningModel),\n    find: find(VoiceCloningModel),\n  }\n}\nconst AWS = require('aws-sdk')\nAWS.config.update({ region: 'us-west-2' })\nconst sqsService = require('./sqs_service')\nconst sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n\nmodule.exports = sqsService\nconst AWS = require('aws-sdk')\n\nconst sqs = new AWS.SQS({ apiVersion: '2012-11-05' })\n\nconst StringifyUtils = require('../utils/logService')\n\nconst fetchMessageFromSQS = (sqsQueueUrl, waitTimeInSeconds = 0) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      WaitTimeSeconds: waitTimeInSeconds,\n      QueueUrl: sqsQueueUrl /* required */,\n    }\n    sqs.receiveMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in fetchJobFromSQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        resolve(data)\n      }\n    })\n  })\n}\n\nconst deleteMessageFromSQS = (sqsQueueUrl, receiptHandle) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      ReceiptHandle: receiptHandle,\n      QueueUrl: sqsQueueUrl /* required */,\n    }\n    sqs.deleteMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in sending delete request to AWS.SQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        console.log(\n          'Successfully sent delete request to AWS.SQS',\n          StringifyUtils.stringifyError(data)\n        )\n        resolve(data)\n      }\n    })\n  })\n}\n\nconst sendMessageToSQS = (sqsQueueUrl, message) => {\n  return new Promise((resolve, reject) => {\n    const params = {\n      MessageBody: message,\n      QueueUrl: sqsQueueUrl /* required */,\n      // MessageGroupId:\n      //   process.env.POTION_APP_ENV ||\n      //   '' + `_` + uuidV4() + '_' + new Date().toISOString(),\n      // MessageDeduplicationId: uuidV4() + `_` + new Date().toISOString()\n    }\n    sqs.sendMessage(params, function (err, data) {\n      if (err) {\n        reject(err)\n        console.log(\n          `ERROR in seding request to AWS.SQS : `,\n          StringifyUtils.stringifyError(err)\n        )\n      } else {\n        console.log(\n          'Successfully sent request to AWS.SQS',\n          StringifyUtils.stringifyError(data)\n        )\n        resolve(data.Location)\n      }\n    })\n  })\n}\n\nmodule.exports = {\n  fetchMessageFromSQS,\n  deleteMessageFromSQS,\n  sendMessageToSQS,\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_21","type":"command_execution","command":"/bin/bash -lc 'for f in .styx_prs/*.json; do rg -n \"tenant|userId|voice|synth|background|isolation|SQS\" \"$f\" && sed -n '\"'1,260p' \\\"\"'$f\"; done'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_21","type":"command_execution","command":"/bin/bash -lc 'for f in .styx_prs/*.json; do rg -n \"tenant|userId|voice|synth|background|isolation|SQS\" \"$f\" && sed -n '\"'1,260p' \\\"\"'$f\"; done'","aggregated_output":"6:  \"url\": \"https://github.com/potion/potion-voice/pull/1\",\n41:          \"message\": \"Initial commit of Potion voice repo based on the VITS implementation by coqui-ai/TTS.\",\n125:        \"path\": \"voice-cloning/clone_voice.py\",\n131:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n137:        \"path\": \"voice-cloning/synthesize_speech.py\",\n143:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n{\n  \"number\": 1,\n  \"title\": \"Initial commit\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/1\",\n  \"createdAt\": \"2022-04-21T13:53:32Z\",\n  \"mergedAt\": \"2022-04-21T13:53:54Z\",\n  \"closedAt\": \"2022-04-21T13:53:54Z\",\n  \"additions\": 1003,\n  \"deletions\": 0,\n  \"changedFiles\": 6,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"initialCommit\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"367ecad92dbaf831382a9262e017409a4aa7ec38\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 4,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"da4ff050ff67740bf97fa0292903604dcf4d8452\",\n          \"message\": \"Initial commit of Potion voice repo based on the VITS implementation by coqui-ai/TTS.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-04T16:13:45Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-04T16:13:45Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"f6c7d822d009121685f25fbff90f2727884775d4\",\n          \"message\": \"Updated usage documentation\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-07T15:30:00Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-07T15:30:00Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"70b01e98c91bf6e808d0bdf849226512220aa72c\",\n          \"message\": \"Updated exclusions.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T13:48:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T13:48:34Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"0f4cd72a1960b87471e2865b55f804f62189bccb\",\n          \"message\": \"Corrected exclusions.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T13:50:15Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T13:50:15Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \".gitignore\",\n        \"additions\": 8,\n        \"deletions\": 0,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"requirements.txt\",\n        \"additions\": 8,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"voice-cloning/clone_voice.py\",\n        \"additions\": 212,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n        \"additions\": 437,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"voice-cloning/synthesize_speech.py\",\n        \"additions\": 139,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n        \"additions\": 199,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/10\",\n15:  \"headRefName\": \"update-voice-cloning-to-use-original-text\",\n81:        \"url\": \"https://github.com/potion/potion-voice/pull/10#pullrequestreview-1242087815\",\n94:        \"path\": \"voice-cloning-job-handler/index.js\",\n{\n  \"number\": 10,\n  \"title\": \"updated code for using original text\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/10\",\n  \"createdAt\": \"2023-01-10T09:39:58Z\",\n  \"mergedAt\": \"2023-01-10T12:13:20Z\",\n  \"closedAt\": \"2023-01-10T12:13:20Z\",\n  \"additions\": 2,\n  \"deletions\": 2,\n  \"changedFiles\": 1,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"update-voice-cloning-to-use-original-text\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"64766ed9370d9b2da5914b3416dc6ad9271cd156\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"2e8d6cabb09f54db2ea37534ff1c0e25f0d87fba\",\n          \"message\": \"Uploaded code for using original text\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-10T09:38:17Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-10T09:38:17Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"caa711f0a6d297fa51d1bbafa0f9180356a0baa8\",\n          \"message\": \"Uploaded code for using original text\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-10T09:40:32Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-10T09:40:32Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2023-01-10T12:13:14Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/10#pullrequestreview-1242087815\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/11\",\n15:  \"headRefName\": \"voice-ai-v2-changes\",\n185:          \"message\": \"Merge branch 'main' into voice-ai-v2-changes\",\n345:          \"message\": \"Added changes for the synthesize command\",\n361:          \"message\": \"updated voice-ai-changes\",\n409:          \"message\": \"Updated code for synthesis\",\n425:          \"message\": \"Updated code for synthesis\",\n497:        \"url\": \"https://github.com/potion/potion-voice/pull/11#pullrequestreview-1280363999\",\n522:        \"path\": \"voice-cloning-job-handler/index.js\",\n528:        \"path\": \"voice-cloning-job-handler/package-lock.json\",\n534:        \"path\": \"voice-cloning-job-handler/package.json\",\n540:        \"path\": \"voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\",\n546:        \"path\": \"voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\",\n552:        \"path\": \"voice-cloning-job-handler/yarn.lock\",\n558:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n564:        \"path\": \"voice-synthsizer-job-handler/recording_salutation/index.js\",\n570:        \"path\": \"voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\",\n{\n  \"number\": 11,\n  \"title\": \"Voice ai v2 changes\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/11\",\n  \"createdAt\": \"2023-02-01T09:10:44Z\",\n  \"mergedAt\": \"2023-02-02T05:32:22Z\",\n  \"closedAt\": \"2023-02-02T05:32:22Z\",\n  \"additions\": 200,\n  \"deletions\": 6819,\n  \"changedFiles\": 12,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"voice-ai-v2-changes\",\n  \"author\": {\n    \"login\": \"author_6\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"14c3c3630a14ab220a13d4b0ce2ac7a2b9c2ab2d\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 28,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"09895be273030cf75781b88a43581db15e2b537f\",\n          \"message\": \"Some cleanup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:39:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:39:34Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"477c39922d6f1f8bf474d6aa215dbf7f745629af\",\n          \"message\": \"Some cleanup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:46Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"81a3e340d28c15313cf363697ea35e401bd48c30\",\n          \"message\": \"Some cleanup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"920ab8ac6ba9b428d30b655a12533e7491c17ad2\",\n          \"message\": \"Added todos\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-13T07:54:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-13T07:54:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"18e04e2e4e9ae7eef5d77d86cb83bf1efea7fbd4\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T17:46:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T17:46:46Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"31996261302205e07e9135750c71ba6c227e81ee\",\n          \"message\": \"update the python command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T18:36:48Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T18:36:48Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d6a4ca9809bd3e61bce09d81534c85582a6648c4\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:42:04Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:42:04Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"5dbe54bf0674a0323fb237d2549b3bccab8b1bae\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:50:16Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:50:16Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"103d47f263421ab090097825883fe33f9cbd1830\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:51:23Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:51:23Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"de9256d575777382caee28192d6e7321d4f6cf37\",\n          \"message\": \"Merge branch 'main' into voice-ai-v2-changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T15:30:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T15:30:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"4054eaeabf53f7a1477134496e26d1b323a89211\",\n          \"message\": \"Removed unwanted package\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:24:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:24:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"676ae4419c2c00340a6e0ddbc2ebedaf547b984b\",\n          \"message\": \"updated zip command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:31:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:31:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a1d7a29e837f4c508245ed6158c07accfe1ab550\",\n          \"message\": \"Updated path\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:47:26Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:47:26Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"9eac7f855681a903b6372d74a0252ffa3f4f6ceb\",\n          \"message\": \"Updated zippath\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:59:07Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:59:07Z\"\n          }\n        }\n3:  \"title\": \"Ai 490 adv synth\",\n4:  \"body\": \"Added:\\r\\n+ optional speech sample waveform and text parameter support for style transfer\\r\\n+ upsampling of synthetic speech output to target sampling rate (48kHz by default)\\r\\n\\r\\nUpdated:\\r\\n+ usage documentation\",\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/12\",\n15:  \"headRefName\": \"ai-490-adv-synth\",\n61:          \"message\": \"Cleaned up and documented extended synthesising approach.\",\n85:        \"url\": \"https://github.com/potion/potion-voice/pull/12#pullrequestreview-1280364688\",\n97:        \"url\": \"https://github.com/potion/potion-voice/pull/12#pullrequestreview-1280367849\",\n110:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n116:        \"path\": \"voice-cloning/synthesize_speech.py\",\n122:        \"path\": \"voice-cloning/utils/synthesize_utils.py\",\n{\n  \"number\": 12,\n  \"title\": \"Ai 490 adv synth\",\n  \"body\": \"Added:\\r\\n+ optional speech sample waveform and text parameter support for style transfer\\r\\n+ upsampling of synthetic speech output to target sampling rate (48kHz by default)\\r\\n\\r\\nUpdated:\\r\\n+ usage documentation\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/12\",\n  \"createdAt\": \"2023-02-01T17:09:41Z\",\n  \"mergedAt\": \"2023-02-02T05:52:09Z\",\n  \"closedAt\": \"2023-02-02T05:52:09Z\",\n  \"additions\": 42,\n  \"deletions\": 21,\n  \"changedFiles\": 3,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"ai-490-adv-synth\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"9de3769f0cfe8a81dbccf331702452f2c0112987\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": [\n      {\n        \"login\": \"author_6\"\n      }\n    ]\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"6645341cf0150d9c2f3766c885fe8891660e2ac5\",\n          \"message\": \"Synthesising audio with optional speech samples for style transfer; upsampling output to target sampling rate (48kHz as default).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-01T16:51:24Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-01T16:51:24Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"b2d1cd59e7bd8a0a1d8a1606664230882e988d15\",\n          \"message\": \"Cleaned up and documented extended synthesising approach.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-01T17:05:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-01T17:05:34Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_7\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2023-02-02T05:33:12Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/12#pullrequestreview-1280364688\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      },\n      {\n        \"author\": {\n          \"login\": \"author_7\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2023-02-02T05:38:09Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/12#pullrequestreview-1280367849\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n        \"additions\": 10,\n        \"deletions\": 3,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/synthesize_speech.py\",\n        \"additions\": 23,\n        \"deletions\": 8,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/utils/synthesize_utils.py\",\n        \"additions\": 9,\n        \"deletions\": 10,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/13\",\n69:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n{\n  \"number\": 13,\n  \"title\": \"Added sr48000 for wave\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/13\",\n  \"createdAt\": \"2023-02-02T05:50:19Z\",\n  \"mergedAt\": \"2023-02-02T05:53:02Z\",\n  \"closedAt\": \"2023-02-02T05:53:02Z\",\n  \"additions\": 1,\n  \"deletions\": 1,\n  \"changedFiles\": 1,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"fix-output-for-wav\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"e54a3b5cec759c2269cfb3e02c26f9674699a26b\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": [\n      {\n        \"login\": \"author_6\"\n      }\n    ]\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"6facd07321ab07dd4bdf2b4decbdd652c24cb442\",\n          \"message\": \"Added sr48000 for wave\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-02T05:49:36Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-02T05:49:36Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-synthsizer-job-handler/index.js\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/14\",\n41:          \"message\": \"Add ffmpeg to system-wide install requirements (synthesize_speech requires this now, but it's missing from the documentation).\",\n57:          \"message\": \"Added new capability to test and rank a set of multi-speaker models (using Resemblyzer-based voice similarity).\",\n81:        \"url\": \"https://github.com/potion/potion-voice/pull/14#pullrequestreview-1282766813\",\n94:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n100:        \"path\": \"voice-cloning/score_models.py\",\n{\n  \"number\": 14,\n  \"title\": \"New feature score model\",\n  \"body\": \"No impact on staging / prod ... just for dev / training.\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/14\",\n  \"createdAt\": \"2023-02-03T04:11:03Z\",\n  \"mergedAt\": \"2023-02-03T10:51:48Z\",\n  \"closedAt\": \"2023-02-03T10:51:48Z\",\n  \"additions\": 220,\n  \"deletions\": 1,\n  \"changedFiles\": 2,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"new-feature-score-model\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"4d32b78bf90cd62384f5a788c1d5e19f61e27007\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"25c21387320b085eec8c3a223fcb4ca44d952247\",\n          \"message\": \"Add ffmpeg to system-wide install requirements (synthesize_speech requires this now, but it's missing from the documentation).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-02T15:17:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-02T15:25:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"18f64f968a0b75f2b26a11e337dd596413055f5f\",\n          \"message\": \"Added new capability to test and rank a set of multi-speaker models (using Resemblyzer-based voice similarity).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T04:08:02Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T04:08:02Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_7\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2023-02-03T10:51:37Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/14#pullrequestreview-1282766813\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/score_models.py\",\n        \"additions\": 219,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/15\",\n48:          \"message\": \"Refined voice cloning to support new capabilities to determine best model; updated recently adde capability to determine best multi-speaker model.\",\n344:        \"path\": \"voice-cloning-job-handler/index.js\",\n350:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n356:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n362:        \"path\": \"voice-cloning/clone_voice.py\",\n368:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n374:        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n380:        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n386:        \"path\": \"voice-cloning/prepare_datasets.py\",\n392:        \"path\": \"voice-cloning/score_cloned_voice.py\",\n398:        \"path\": \"voice-cloning/train_config.py\",\n404:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n410:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n{\n  \"number\": 15,\n  \"title\": \"New feature score model\",\n  \"body\": \"Improved and documented the new find_best_* model scripts.\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/15\",\n  \"createdAt\": \"2023-02-07T15:46:36Z\",\n  \"mergedAt\": \"2023-04-21T04:50:02Z\",\n  \"closedAt\": \"2023-04-21T04:50:02Z\",\n  \"additions\": 421,\n  \"deletions\": 68,\n  \"changedFiles\": 12,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"new-feature-score-model\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"da6d4e590a2db6dde5c4ab55147d277f8856e05e\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": [\n      {\n        \"login\": \"author_6\"\n      },\n      {\n        \"login\": \"author_7\"\n      }\n    ]\n  },\n  \"commits\": {\n    \"totalCount\": 18,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"ba8c0bb2527ea447d4d3ac69a44ccb442419f1ce\",\n          \"message\": \"Refined voice cloning to support new capabilities to determine best model; updated recently adde capability to determine best multi-speaker model.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-06T17:33:28Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-06T17:33:28Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"bbfa2b24aecd57f0ff35f94815b004de33a81218\",\n          \"message\": \"Added json output option.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T09:54:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T09:54:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"3d19bbd67f252f521da92142897f4f4bd46bd1b3\",\n          \"message\": \"Added syntax & usage examples for new find_best_* scripts; improved code readability\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T15:42:44Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T15:42:44Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"f452e872f96136c1985f1ab30efc03e25e333ccc\",\n          \"message\": \"Minor bug fix: mispelling of variable corrected.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T07:49:08Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T07:49:08Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"b575d70b7331c56fc1ae1bef5055c20cbf80c450\",\n          \"message\": \"out.cloned_model_path now returns the full path, not just the path to the output folder.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T14:48:43Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T14:48:43Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a2b8a49be22efb291a3ece06d4098ceb9853210e\",\n          \"message\": \"Added updates for new feature\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:45:44Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:45:44Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a4e6cb973a5d0be91eac08d6400bbaa543ccb3e1\",\n          \"message\": \"updated env\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:50:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:50:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"e7eeb7e4e70698fc6ef9353bc9c4898efbb99ecc\",\n          \"message\": \"Added console\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T07:15:11Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T07:15:11Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d965399eb9437e2d8623a4d89ffbfd5a85a3d2b1\",\n          \"message\": \"Bug fix: dataset naming conventions back in sync.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T09:58:10Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T09:58:10Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d342b87cd82ba38bfc5f4ed680d0841754065c17\",\n          \"message\": \"Merge branch 'new-feature-score-model' into new-feature-updates\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T11:55:54Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T11:55:54Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"8d2af53303db512e74c497cc17b43f9e7e6d61e8\",\n          \"message\": \"Added changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T13:41:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T13:41:34Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"2dab89e74c7721718f844c984ca628ac5b95e12c\",\n          \"message\": \"Added path changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T15:11:43Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T15:11:43Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"ba03da7512be4d8e094fd8efe867af47eb73216d\",\n          \"message\": \"Added path changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T16:42:02Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T16:42:02Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c04ece4f8c09085ce2db37e4dd1831e89a9adc53\",\n          \"message\": \"Added path changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T17:30:10Z\"\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/16\",\n185:          \"message\": \"Merge branch 'main' into voice-ai-v2-changes\",\n345:          \"message\": \"Added changes for the synthesize command\",\n361:          \"message\": \"updated voice-ai-changes\",\n409:          \"message\": \"Updated code for synthesis\",\n425:          \"message\": \"Updated code for synthesis\",\n489:          \"message\": \"Cleaned up and documented extended synthesising approach.\",\n521:          \"message\": \"Merge pull request #11 from potion/voice-ai-v2-changes\\n\\nVoice ai v2 changes\",\n553:          \"message\": \"Merge pull request #12 from potion/ai-490-adv-synth\\n\\nAi 490 adv synth\",\n585:          \"message\": \"Add ffmpeg to system-wide install requirements (synthesize_speech requires this now, but it's missing from the documentation).\",\n601:          \"message\": \"Added new capability to test and rank a set of multi-speaker models (using Resemblyzer-based voice similarity).\",\n641:        \"url\": \"https://github.com/potion/potion-voice/pull/16#pullrequestreview-1295270316\",\n666:        \"path\": \"voice-cloning-job-handler/index.js\",\n672:        \"path\": \"voice-cloning-job-handler/package-lock.json\",\n678:        \"path\": \"voice-cloning-job-handler/package.json\",\n684:        \"path\": \"voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\",\n690:        \"path\": \"voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\",\n696:        \"path\": \"voice-cloning-job-handler/yarn.lock\",\n702:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n708:        \"path\": \"voice-cloning/score_models.py\",\n714:        \"path\": \"voice-cloning/synthesize_speech.py\",\n720:        \"path\": \"voice-cloning/utils/synthesize_utils.py\",\n726:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n732:        \"path\": \"voice-synthsizer-job-handler/recording_salutation/index.js\",\n738:        \"path\": \"voice-synthsizer-job-handler/recording_salutation/recording_salutation_model.js\",\n{\n  \"number\": 16,\n  \"title\": \"Staging > Main\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/16\",\n  \"createdAt\": \"2023-02-13T04:47:47Z\",\n  \"mergedAt\": \"2023-02-13T09:49:07Z\",\n  \"closedAt\": \"2023-02-13T09:49:07Z\",\n  \"additions\": 463,\n  \"deletions\": 6842,\n  \"changedFiles\": 16,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"staging\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"b704d803d14b4a61516927e0e348a5cf3cef844e\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 37,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"09895be273030cf75781b88a43581db15e2b537f\",\n          \"message\": \"Some cleanup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:39:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:39:34Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"477c39922d6f1f8bf474d6aa215dbf7f745629af\",\n          \"message\": \"Some cleanup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:46Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"81a3e340d28c15313cf363697ea35e401bd48c30\",\n          \"message\": \"Some cleanup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-12T15:41:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"920ab8ac6ba9b428d30b655a12533e7491c17ad2\",\n          \"message\": \"Added todos\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-13T07:54:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-13T07:54:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"18e04e2e4e9ae7eef5d77d86cb83bf1efea7fbd4\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T17:46:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T17:46:46Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"31996261302205e07e9135750c71ba6c227e81ee\",\n          \"message\": \"update the python command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T18:36:48Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-16T18:36:48Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d6a4ca9809bd3e61bce09d81534c85582a6648c4\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:42:04Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:42:04Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"5dbe54bf0674a0323fb237d2549b3bccab8b1bae\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:50:16Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:50:16Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"103d47f263421ab090097825883fe33f9cbd1830\",\n          \"message\": \"Added code for v2 changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:51:23Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-17T07:51:23Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"de9256d575777382caee28192d6e7321d4f6cf37\",\n          \"message\": \"Merge branch 'main' into voice-ai-v2-changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T15:30:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T15:30:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"4054eaeabf53f7a1477134496e26d1b323a89211\",\n          \"message\": \"Removed unwanted package\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:24:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:24:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"676ae4419c2c00340a6e0ddbc2ebedaf547b984b\",\n          \"message\": \"updated zip command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:31:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:31:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a1d7a29e837f4c508245ed6158c07accfe1ab550\",\n          \"message\": \"Updated path\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:47:26Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:47:26Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"9eac7f855681a903b6372d74a0252ffa3f4f6ceb\",\n          \"message\": \"Updated zippath\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:59:07Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-01-18T19:59:07Z\"\n          }\n        }\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/17\",\n225:        \"url\": \"https://github.com/potion/potion-voice/pull/17#pullrequestreview-1331346663\",\n238:        \"path\": \"voice-cloning-job-handler/index.js\",\n244:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n250:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n256:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n{\n  \"number\": 17,\n  \"title\": \"New feature updates\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/17\",\n  \"createdAt\": \"2023-03-03T05:14:09Z\",\n  \"mergedAt\": \"2023-03-08T19:59:08Z\",\n  \"closedAt\": \"2023-03-08T19:59:08Z\",\n  \"additions\": 61,\n  \"deletions\": 32,\n  \"changedFiles\": 4,\n  \"isDraft\": false,\n  \"baseRefName\": \"new-feature-score-model\",\n  \"headRefName\": \"new-feature-updates\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"6f04f67524f32fe63e334373b5aa445703740b9c\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 11,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"a2b8a49be22efb291a3ece06d4098ceb9853210e\",\n          \"message\": \"Added updates for new feature\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:45:44Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:45:44Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a4e6cb973a5d0be91eac08d6400bbaa543ccb3e1\",\n          \"message\": \"updated env\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:50:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:50:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"e7eeb7e4e70698fc6ef9353bc9c4898efbb99ecc\",\n          \"message\": \"Added console\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T07:15:11Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T07:15:11Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d342b87cd82ba38bfc5f4ed680d0841754065c17\",\n          \"message\": \"Merge branch 'new-feature-score-model' into new-feature-updates\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T11:55:54Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T11:55:54Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"8d2af53303db512e74c497cc17b43f9e7e6d61e8\",\n          \"message\": \"Added changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T13:41:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T13:41:34Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"2dab89e74c7721718f844c984ca628ac5b95e12c\",\n          \"message\": \"Added path changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T15:11:43Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T15:11:43Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"ba03da7512be4d8e094fd8efe867af47eb73216d\",\n          \"message\": \"Added path changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T16:42:02Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T16:42:02Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c04ece4f8c09085ce2db37e4dd1831e89a9adc53\",\n          \"message\": \"Added path changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T17:30:10Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T17:30:10Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"224358eb5313bd84653159c0b9285b593d7c543e\",\n          \"message\": \"Added changes to model name\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T18:15:55Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T18:16:01Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"bd02cf536700604a600554b9b22d4ce759660763\",\n          \"message\": \"Added changes to model name\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T18:20:20Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T18:20:25Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"70ce62652dcd27038eebeaa6aa237f31099850b2\",\n          \"message\": \"Added code for removing speakers\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-03-03T06:19:41Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-03-03T06:19:41Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2023-03-08T19:59:00Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/17#pullrequestreview-1331346663\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 53,\n        \"deletions\": 28,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/index.js\",\n        \"additions\": 6,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      }\n3:  \"title\": \"Refined voice cloning settings\",\n4:  \"body\": \"Update settings for voice cloning.\",\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/18\",\n73:          \"message\": \"Merge branch 'develop' of https://github.com/potion/potion-voice into develop\",\n249:          \"message\": \"Added new voice conversion option (idea 1: convert from multi-speaker model; idea 2: clone voice, synthesize speech, convert into recorded template; ...).\",\n281:          \"message\": \"Added new voice cloning approach (using fine-tuning via continue_path).\",\n457:          \"message\": \"Added scale related synth parameters (to be tested / refined).\",\n563:        \"url\": \"https://github.com/potion/potion-voice/pull/18#issuecomment-1563235903\"\n600:        \"path\": \"voice-cloning/clone_voice.py\",\n606:        \"path\": \"voice-cloning/clone_voice_via_continue.py\",\n612:        \"path\": \"voice-cloning/convert_voice.py\",\n618:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n624:        \"path\": \"voice-cloning/prepare_datasets.py\",\n630:        \"path\": \"voice-cloning/save_multispeaker_baseline_embeddings_file.py\",\n636:        \"path\": \"voice-cloning/synthesize_speech.py\",\n642:        \"path\": \"voice-cloning/train_config.py\",\n648:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n654:        \"path\": \"voice-cloning/utils/synthesize_utils.py\",\n{\n  \"number\": 18,\n  \"title\": \"Refined voice cloning settings\",\n  \"body\": \"Update settings for voice cloning.\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/18\",\n  \"createdAt\": \"2023-04-21T05:10:41Z\",\n  \"mergedAt\": \"2023-06-21T10:58:16Z\",\n  \"closedAt\": \"2023-06-21T10:58:17Z\",\n  \"additions\": 1152,\n  \"deletions\": 146,\n  \"changedFiles\": 15,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"develop\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"54efcabc34b82b156ab06a0beab0f895d4c7edd0\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 32,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"a47c5e000965b8c38d742a512d88c20d457cfd6a\",\n          \"message\": \"Refined checkpointing and enabled weighted sampler for multi-speaker baseline training.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:55:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:55:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c58120f853b1c7549818d7f7194d6fb901ebbc39\",\n          \"message\": \"Refined checkpointing and enabled weighted sampler for multi-speaker baseline training.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:55:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:56:49Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c53d9e44c068880953046b1ceab8e6da82b7f60c\",\n          \"message\": \"Merge branch 'develop' of https://github.com/potion/potion-voice into develop\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T18:02:10Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T18:02:10Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"237c552fb6dafcf22c2213e69692cd22d6df43e1\",\n          \"message\": \"Merge branch 'staging' into develop\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-04-21T05:13:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-04-21T05:13:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"452d734aefe8407bc0b018fa1974acbe1429dd05\",\n          \"message\": \"Added support for Potion Diverse and Mozilla Common Voice data-sets as well as for continuation of training runs.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-04-27T02:37:20Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-04-27T02:37:20Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c811784a9e37b78698f913bc63c76868e14b902f\",\n          \"message\": \"Merge conflict resolved (naming convention diversion addressed.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-04-27T02:45:15Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-04-27T02:45:15Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"940e2d1af624e35dec9447b91495a2908c95c7b5\",\n          \"message\": \"Test sentences added based on dataset arguments; training parameters revised; phoneme usage supported as argument.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-05T15:35:00Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-05T15:35:00Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d6dea65f95cc3a8d8f3e37f62cc022f908a1a936\",\n          \"message\": \"Add loss to config explicitely; use different resblock_type_decoder by default\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-09T07:09:26Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-09T07:09:26Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"4a9ddf2b561bf6240d3d03da8671e77b7e7ed78a\",\n          \"message\": \"phoneme support; updated training parameters; removed use_cpu option (unsupported).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-15T07:48:30Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-15T07:48:30Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"2563f8dee714cd8b83e72a511c37c7daa4db5c19\",\n          \"message\": \"Remove overwrite of phoneme usage; use setting from config.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-15T16:07:22Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-15T16:07:22Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"31dd16cc50d27f434b0afa719f44ad4565a9f17b\",\n          \"message\": \"Added new script to generate a merged speaker embeddings file (for multiple datasets).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-17T16:14:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-17T16:14:46Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"96680990014cc7c8943fdec303e04299ec5a5914\",\n          \"message\": \"Minor bug fix (argument misspelled).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-17T16:24:30Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-17T16:24:30Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a70ed6dc7f33de96b19390bfa66a2e755e899232\",\n          \"message\": \"Removed unnecessary import; improved comments.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-18T02:27:06Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-18T02:27:06Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"f0a7f3cfa96afbb14defc01c2484559d13a9eb2a\",\n          \"message\": \"Added new voice conversion option (idea 1: convert from multi-speaker model; idea 2: clone voice, synthesize speech, convert into recorded template; ...).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-18T15:39:33Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-05-18T15:39:33Z\"\n          }\n        }\n3:  \"title\": \"Update voice clone 23 05\",\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/19\",\n15:  \"headRefName\": \"update-voice-clone-23-05\",\n89:          \"message\": \"Added changes for synthesizer\",\n153:          \"message\": \"Merge branch 'staging' into update-voice-clone-23-05\",\n209:        \"path\": \"voice-cloning-job-handler/index.js\",\n215:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n221:        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n227:        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n{\n  \"number\": 19,\n  \"title\": \"Update voice clone 23 05\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/19\",\n  \"createdAt\": \"2023-06-21T10:59:07Z\",\n  \"mergedAt\": \"2023-06-27T04:50:28Z\",\n  \"closedAt\": \"2023-06-27T04:50:29Z\",\n  \"additions\": 182,\n  \"deletions\": 91,\n  \"changedFiles\": 4,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"update-voice-clone-23-05\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"6d89d4f3c84b1f743d93d3b1f6cf70472e1866e5\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 10,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"94b4cbeb8e5863366512cbcc413a4a99817bef3d\",\n          \"message\": \"Changed version of python package\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:11:56Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:11:56Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"b254ec4c2842e34c4fb8a807655330916114ea45\",\n          \"message\": \"Added code for new changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:30:27Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:30:27Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d95cae5242691b67688cad0077d0eef1ccf89fb2\",\n          \"message\": \"Added changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T15:00:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T15:00:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"0d7dc5354f866e849645692cd8af93ddd47a624c\",\n          \"message\": \"Added changes for synthesizer\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:02:16Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:02:16Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"219835c25c561b6d6f964c3ac533e2481b483c94\",\n          \"message\": \"Added change\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:10:09Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:10:09Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"58d0c83a2b2525967598d0915d374937e7dfd416\",\n          \"message\": \"Added path change\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:19:08Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:19:08Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"5cb69b8e41743b1b5f7f66e65ea15ff64a0ea945\",\n          \"message\": \"Added changes for not to save the salutation to global\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:51:40Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:51:40Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"58f4b9346d1918f2f83ae249035c8e93d326046c\",\n          \"message\": \"Merge branch 'staging' into update-voice-clone-23-05\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:52:23Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:52:23Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"8aeccc682363a55001fbdb9ec67c861cfb6a8b63\",\n          \"message\": \"Added code for deleting directory\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:15:47Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:15:47Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"e5f6efbb72902997353580ee56b7893c64452165\",\n          \"message\": \"Added delete code for template\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:32:35Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:32:35Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 3,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/index.js\",\n        \"additions\": 170,\n        \"deletions\": 89,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n        \"additions\": 5,\n        \"deletions\": 0,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n        \"additions\": 4,\n        \"deletions\": 0,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/2\",\n81:        \"path\": \"voice-cloning/clone_voice.py\",\n87:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n93:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n{\n  \"number\": 2,\n  \"title\": \"Initial commit\",\n  \"body\": \"Additional improvements for initial commit (coqiau/TTS v0.6.2 compatibility)\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/2\",\n  \"createdAt\": \"2022-04-21T14:49:50Z\",\n  \"mergedAt\": \"2022-04-21T14:50:00Z\",\n  \"closedAt\": \"2022-04-21T14:50:00Z\",\n  \"additions\": 19,\n  \"deletions\": 14,\n  \"changedFiles\": 3,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"initialCommit\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"a1d5a6b458af59b350a684e6fade1d1109b6d236\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"b6abea59339bea8d4923d53fafc3c0e0d7c27ec9\",\n          \"message\": \"Removed install requirements for coqi-ai/Trainer (now a TTS dependency); added pretrained model install requirements.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T14:44:27Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T14:44:27Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"5cc49e28dbfbe823e3043232bc1984bdaf58b05f\",\n          \"message\": \"coquai/TTS v0.6.2 compatibiliuty changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T14:46:02Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T14:46:02Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning/clone_voice.py\",\n        \"additions\": 3,\n        \"deletions\": 3,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n        \"additions\": 13,\n        \"deletions\": 8,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n        \"additions\": 3,\n        \"deletions\": 3,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/20\",\n73:          \"message\": \"Merge branch 'develop' of https://github.com/potion/potion-voice into develop\",\n89:          \"message\": \"Refined voice cloning to support new capabilities to determine best model; updated recently adde capability to determine best multi-speaker model.\",\n553:          \"message\": \"Added new voice conversion option (idea 1: convert from multi-speaker model; idea 2: clone voice, synthesize speech, convert into recorded template; ...).\",\n585:          \"message\": \"Added new voice cloning approach (using fine-tuning via continue_path).\",\n761:          \"message\": \"Added scale related synth parameters (to be tested / refined).\",\n873:          \"message\": \"Added changes for synthesizer\",\n953:          \"message\": \"Merge pull request #18 from potion/develop\\n\\nRefined voice cloning settings\",\n985:          \"message\": \"Merge branch 'staging' into update-voice-clone-23-05\",\n1033:          \"message\": \"Merge pull request #19 from potion/update-voice-clone-23-05\\n\\nUpdate voice clone 23 05\",\n1641:          \"message\": \"Merge branch 'develop' of https://github.com/potion/potion-voice into develop\",\n1657:          \"message\": \"Bug fix: Wrong path used for synth samples.\",\n1705:          \"message\": \"voice quality score redefined: 3/4 sim_scoe and 1/4 nat_score.\",\n1737:          \"message\": \"Bug fix: Adjust to prev name change of init_synth argument.\",\n1877:        \"path\": \"voice-cloning-job-handler/index.js\",\n1883:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n1889:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n1895:        \"path\": \"voice-cloning/clone_voice.py\",\n1901:        \"path\": \"voice-cloning/clone_voice_via_continue.py\",\n1907:        \"path\": \"voice-cloning/convert_voice.py\",\n1913:        \"path\": \"voice-cloning/docs/Voice Cloning @ 48k Hz Sampling Rate - Step-by-Step.txt\",\n1919:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n1925:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide_-_CPU_only.md\",\n1931:        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n1937:        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n1943:        \"path\": \"voice-cloning/minimize_cloned_voice_model.py\",\n1949:        \"path\": \"voice-cloning/prepare_datasets.py\",\n1955:        \"path\": \"voice-cloning/save_multispeaker_baseline_embeddings_file.py\",\n1961:        \"path\": \"voice-cloning/score_cloned_voice.py\",\n1967:        \"path\": \"voice-cloning/synthesize_speech.py\",\n1973:        \"path\": \"voice-cloning/train_config.py\",\n1979:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n1985:        \"path\": \"voice-cloning/utils/NISQA/LICENSE\",\n1991:        \"path\": \"voice-cloning/utils/NISQA/LICENSE_model_weights\",\n1997:        \"path\": \"voice-cloning/utils/NISQA/NISQA_lib.py\",\n2003:        \"path\": \"voice-cloning/utils/NISQA/NISQA_model.py\",\n2009:        \"path\": \"voice-cloning/utils/NISQA/nisqa_tts.tar\",\n2015:        \"path\": \"voice-cloning/utils/misc_utils.py\",\n2021:        \"path\": \"voice-cloning/utils/scoring_utils.py\",\n2027:        \"path\": \"voice-cloning/utils/synthesize_utils.py\",\n2033:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n2039:        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n2045:        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n{\n  \"number\": 20,\n  \"title\": \"Staging > Main\",\n  \"body\": \"\",\n  \"state\": \"OPEN\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/20\",\n  \"createdAt\": \"2023-06-27T05:14:57Z\",\n  \"mergedAt\": null,\n  \"closedAt\": null,\n  \"additions\": 5802,\n  \"deletions\": 411,\n  \"changedFiles\": 35,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"staging\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"5f990219b779b0e880f57d67eca2b496d4ebe5ef\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 112,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"a47c5e000965b8c38d742a512d88c20d457cfd6a\",\n          \"message\": \"Refined checkpointing and enabled weighted sampler for multi-speaker baseline training.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:55:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:55:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c58120f853b1c7549818d7f7194d6fb901ebbc39\",\n          \"message\": \"Refined checkpointing and enabled weighted sampler for multi-speaker baseline training.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:55:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T17:56:49Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c53d9e44c068880953046b1ceab8e6da82b7f60c\",\n          \"message\": \"Merge branch 'develop' of https://github.com/potion/potion-voice into develop\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T18:02:10Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-03T18:02:10Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"ba8c0bb2527ea447d4d3ac69a44ccb442419f1ce\",\n          \"message\": \"Refined voice cloning to support new capabilities to determine best model; updated recently adde capability to determine best multi-speaker model.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-06T17:33:28Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-06T17:33:28Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"bbfa2b24aecd57f0ff35f94815b004de33a81218\",\n          \"message\": \"Added json output option.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T09:54:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T09:54:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"3d19bbd67f252f521da92142897f4f4bd46bd1b3\",\n          \"message\": \"Added syntax & usage examples for new find_best_* scripts; improved code readability\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T15:42:44Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-07T15:42:44Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"f452e872f96136c1985f1ab30efc03e25e333ccc\",\n          \"message\": \"Minor bug fix: mispelling of variable corrected.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T07:49:08Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T07:49:08Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"b575d70b7331c56fc1ae1bef5055c20cbf80c450\",\n          \"message\": \"out.cloned_model_path now returns the full path, not just the path to the output folder.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T14:48:43Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-13T14:48:43Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a2b8a49be22efb291a3ece06d4098ceb9853210e\",\n          \"message\": \"Added updates for new feature\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:45:44Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:45:44Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a4e6cb973a5d0be91eac08d6400bbaa543ccb3e1\",\n          \"message\": \"updated env\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:50:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T06:50:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"e7eeb7e4e70698fc6ef9353bc9c4898efbb99ecc\",\n          \"message\": \"Added console\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T07:15:11Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T07:15:11Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d965399eb9437e2d8623a4d89ffbfd5a85a3d2b1\",\n          \"message\": \"Bug fix: dataset naming conventions back in sync.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T09:58:10Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T09:58:10Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d342b87cd82ba38bfc5f4ed680d0841754065c17\",\n          \"message\": \"Merge branch 'new-feature-score-model' into new-feature-updates\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T11:55:54Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T11:55:54Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"8d2af53303db512e74c497cc17b43f9e7e6d61e8\",\n          \"message\": \"Added changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T13:41:34Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-02-14T13:41:34Z\"\n          }\n        }\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/21\",\n81:        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n87:        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n{\n  \"number\": 21,\n  \"title\": \"Dev find best fixup\",\n  \"body\": \"find_best_* improvements (suppress TTS-based command line output; track progress instead)\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/21\",\n  \"createdAt\": \"2023-07-21T05:14:32Z\",\n  \"mergedAt\": \"2023-07-21T05:14:54Z\",\n  \"closedAt\": \"2023-07-21T05:14:54Z\",\n  \"additions\": 88,\n  \"deletions\": 53,\n  \"changedFiles\": 2,\n  \"isDraft\": false,\n  \"baseRefName\": \"develop\",\n  \"headRefName\": \"dev-find-best-fixup\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"a6639dbbae3c7920b312b5077aea4a9b42c18e1e\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"f456697d843e83a34b1b5c192ced548bd10ae9d5\",\n          \"message\": \"Add progress tracker and suppress default TTS command-line outputs.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-17T08:32:37Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-17T08:32:37Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"dacf5b23d8581e816104868923dfc5d872960e5e\",\n          \"message\": \"Add progress tracker and suppress default TTS command-line outputs (part 2).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-18T15:24:55Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-18T15:24:55Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n        \"additions\": 42,\n        \"deletions\": 22,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n        \"additions\": 46,\n        \"deletions\": 31,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/22\",\n87:        \"path\": \"voice-cloning/clone_voice_via_continue.py\",\n93:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide_-_CPU_only.md\",\n99:        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n105:        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n111:        \"path\": \"voice-cloning/prepare_datasets.py\",\n117:        \"path\": \"voice-cloning/score_cloned_voice.py\",\n123:        \"path\": \"voice-cloning/synthesize_speech.py\",\n{\n  \"number\": 22,\n  \"title\": \"Dev cpu only\",\n  \"body\": \"CPU-only processing support (tested)\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/22\",\n  \"createdAt\": \"2023-07-25T09:44:12Z\",\n  \"mergedAt\": \"2023-07-25T09:44:26Z\",\n  \"closedAt\": \"2023-07-25T09:44:26Z\",\n  \"additions\": 604,\n  \"deletions\": 28,\n  \"changedFiles\": 8,\n  \"isDraft\": false,\n  \"baseRefName\": \"develop\",\n  \"headRefName\": \"dev-cpu-only\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"19894f8d753f8b5ecf7fb8ee756b63c4498f0fe9\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"31234863f06285dcb88732cff5eead330ab852ad\",\n          \"message\": \"Minor improvements to support CPU-only processing.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T07:52:47Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T07:52:47Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c96dccfb58c49186ee21c4fb24eff96302b35ecf\",\n          \"message\": \"Added more usage examples and necessary Coqui.ai TTS changes.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T09:43:09Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T09:43:09Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"requirements.prod.cpu.txt\",\n        \"additions\": 3,\n        \"deletions\": 4,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/clone_voice_via_continue.py\",\n        \"additions\": 3,\n        \"deletions\": 3,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide_-_CPU_only.md\",\n        \"additions\": 578,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n        \"additions\": 4,\n        \"deletions\": 4,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/prepare_datasets.py\",\n        \"additions\": 5,\n        \"deletions\": 6,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/score_cloned_voice.py\",\n        \"additions\": 3,\n        \"deletions\": 3,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/synthesize_speech.py\",\n        \"additions\": 6,\n        \"deletions\": 6,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}4:  \"body\": \"Support of 48k Hz sampling rate as default; GPU and CPU-based usage for all scripts but baseline training run.\\r\\n\\r\\nSee voice-cloning/docs/Voice\\\\ Cloning\\\\ @\\\\ 48k\\\\ Hz\\\\ Sampling\\\\ Rate\\\\ -\\\\ Step-by-Step.txt for example usage.\\r\\n\\r\\nModel assets can be found at s3://potion-ai-models/potion-voice-2023-08/\",\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/23\",\n633:          \"message\": \"Merge branch 'develop' of https://github.com/potion/potion-voice into develop\",\n649:          \"message\": \"Bug fix: Wrong path used for synth samples.\",\n697:          \"message\": \"voice quality score redefined: 3/4 sim_scoe and 1/4 nat_score.\",\n729:          \"message\": \"Bug fix: Adjust to prev name change of init_synth argument.\",\n821:        \"path\": \"voice-cloning-job-handler/index.js\",\n827:        \"path\": \"voice-cloning/clone_voice.py\",\n833:        \"path\": \"voice-cloning/clone_voice_via_continue.py\",\n839:        \"path\": \"voice-cloning/docs/Voice Cloning @ 48k Hz Sampling Rate - Step-by-Step.txt\",\n845:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n851:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide_-_CPU_only.md\",\n857:        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n863:        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n869:        \"path\": \"voice-cloning/minimize_cloned_voice_model.py\",\n875:        \"path\": \"voice-cloning/prepare_datasets.py\",\n881:        \"path\": \"voice-cloning/score_cloned_voice.py\",\n887:        \"path\": \"voice-cloning/synthesize_speech.py\",\n893:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n899:        \"path\": \"voice-cloning/utils/NISQA/LICENSE\",\n905:        \"path\": \"voice-cloning/utils/NISQA/LICENSE_model_weights\",\n911:        \"path\": \"voice-cloning/utils/NISQA/NISQA_lib.py\",\n917:        \"path\": \"voice-cloning/utils/NISQA/NISQA_model.py\",\n923:        \"path\": \"voice-cloning/utils/NISQA/nisqa_tts.tar\",\n929:        \"path\": \"voice-cloning/utils/misc_utils.py\",\n935:        \"path\": \"voice-cloning/utils/scoring_utils.py\",\n941:        \"path\": \"voice-cloning/utils/synthesize_utils.py\",\n{\n  \"number\": 23,\n  \"title\": \"Develop\",\n  \"body\": \"Support of 48k Hz sampling rate as default; GPU and CPU-based usage for all scripts but baseline training run.\\r\\n\\r\\nSee voice-cloning/docs/Voice\\\\ Cloning\\\\ @\\\\ 48k\\\\ Hz\\\\ Sampling\\\\ Rate\\\\ -\\\\ Step-by-Step.txt for example usage.\\r\\n\\r\\nModel assets can be found at s3://potion-ai-models/potion-voice-2023-08/\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/23\",\n  \"createdAt\": \"2023-08-07T06:58:31Z\",\n  \"mergedAt\": \"2023-09-25T07:15:56Z\",\n  \"closedAt\": \"2023-09-25T07:15:56Z\",\n  \"additions\": 4121,\n  \"deletions\": 180,\n  \"changedFiles\": 27,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"develop\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"8d62d38e524bfc62be0b6ac0ebca155ec2c4dda7\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 46,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"6caecc390d8da5c2a0e1028ef5a477a25d0af9b5\",\n          \"message\": \"Switch to 48k as default sampling rate; disable mixed_precision due to possible min()/max() runtime error.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-30T11:29:26Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-30T11:29:26Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"f456697d843e83a34b1b5c192ced548bd10ae9d5\",\n          \"message\": \"Add progress tracker and suppress default TTS command-line outputs.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-17T08:32:37Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-17T08:32:37Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"dacf5b23d8581e816104868923dfc5d872960e5e\",\n          \"message\": \"Add progress tracker and suppress default TTS command-line outputs (part 2).\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-18T15:24:55Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-18T15:24:55Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a6639dbbae3c7920b312b5077aea4a9b42c18e1e\",\n          \"message\": \"Merge pull request #21 from potion/dev-find-best-fixup\\n\\nDev find best fixup\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-21T05:14:54Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-21T05:14:54Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"31234863f06285dcb88732cff5eead330ab852ad\",\n          \"message\": \"Minor improvements to support CPU-only processing.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T07:52:47Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T07:52:47Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c96dccfb58c49186ee21c4fb24eff96302b35ecf\",\n          \"message\": \"Added more usage examples and necessary Coqui.ai TTS changes.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T09:43:09Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T09:43:09Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"19894f8d753f8b5ecf7fb8ee756b63c4498f0fe9\",\n          \"message\": \"Merge pull request #22 from potion/dev-cpu-only\\n\\nDev cpu only\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T09:44:26Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-25T09:44:26Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"2fde687781a036630ad65a1b6438f2bd2fe860c8\",\n          \"message\": \"Updated requirements: git clone --depth 1 --branch v0.16.0 https://github.com/coqui-ai/TTS onwards addresses the CPU-only processing issues.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T07:45:02Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T07:45:02Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"5f74690d758f047d1aa24f03b72dd242cfdf9c14\",\n          \"message\": \"Efficiency improvements: Rearranged loop order and removed re-init of speaker mgr and vocoder.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T16:42:56Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T16:42:56Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"4b83dcd2b33940fb67aa0a2ea726e5f4825709af\",\n          \"message\": \"Moved tqdm to outermost loop.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T16:49:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T16:49:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"ff2efad2181eef60c95855a26a346db3a241ac33\",\n          \"message\": \"Efficiency improvement: Removed re-init of vocoder.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T16:58:54Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-26T16:58:54Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"bfab4e52d152e1c1adb5127d8c52e57e5926d6f2\",\n          \"message\": \"Enable use_speaker_encoder_as_loss byu default.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-27T08:45:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-27T08:45:46Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c4f0738615226b541c2728d8b518c1bb8f422e59\",\n          \"message\": \"Disable use_speaker_encoder_as_loss until we have a 48k speaker encoder.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-27T10:14:48Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-07-27T10:14:48Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"ebc3aabb5b47b92667f5cf38c6ad3eabe927c29b\",\n          \"message\": \"Efficiency improvements: re-use config and speaker embeddings when multiple models are evaluated.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-01T05:19:00Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-01T05:19:00Z\"\n          }\n        }\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/24\",\n89:          \"message\": \"Added changes for synthesizer\",\n137:          \"message\": \"Merge pull request #18 from potion/develop\\n\\nRefined voice cloning settings\",\n169:          \"message\": \"Merge branch 'staging' into update-voice-clone-23-05\",\n217:          \"message\": \"Merge pull request #19 from potion/update-voice-clone-23-05\\n\\nUpdate voice clone 23 05\",\n273:        \"path\": \"voice-cloning-job-handler/index.js\",\n279:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n285:        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n291:        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n{\n  \"number\": 24,\n  \"title\": \"Develop 07 08 code updates\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/24\",\n  \"createdAt\": \"2023-08-07T08:05:54Z\",\n  \"mergedAt\": \"2023-08-07T08:08:05Z\",\n  \"closedAt\": \"2023-08-07T08:08:05Z\",\n  \"additions\": 182,\n  \"deletions\": 91,\n  \"changedFiles\": 4,\n  \"isDraft\": false,\n  \"baseRefName\": \"develop\",\n  \"headRefName\": \"develop-07-08\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"75e78312e8d92560c335f640248bef88e37ddcf7\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 14,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"94b4cbeb8e5863366512cbcc413a4a99817bef3d\",\n          \"message\": \"Changed version of python package\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:11:56Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:11:56Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"b254ec4c2842e34c4fb8a807655330916114ea45\",\n          \"message\": \"Added code for new changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:30:27Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T14:30:27Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d95cae5242691b67688cad0077d0eef1ccf89fb2\",\n          \"message\": \"Added changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T15:00:59Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-03T15:00:59Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"0d7dc5354f866e849645692cd8af93ddd47a624c\",\n          \"message\": \"Added changes for synthesizer\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:02:16Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:02:16Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"219835c25c561b6d6f964c3ac533e2481b483c94\",\n          \"message\": \"Added change\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:10:09Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:10:09Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"58d0c83a2b2525967598d0915d374937e7dfd416\",\n          \"message\": \"Added path change\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:19:08Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-06T18:19:08Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"54efcabc34b82b156ab06a0beab0f895d4c7edd0\",\n          \"message\": \"Merge pull request #18 from potion/develop\\n\\nRefined voice cloning settings\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-21T10:58:16Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-21T10:58:16Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"5cb69b8e41743b1b5f7f66e65ea15ff64a0ea945\",\n          \"message\": \"Added changes for not to save the salutation to global\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:51:40Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:51:40Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"58f4b9346d1918f2f83ae249035c8e93d326046c\",\n          \"message\": \"Merge branch 'staging' into update-voice-clone-23-05\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:52:23Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T03:52:23Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"8aeccc682363a55001fbdb9ec67c861cfb6a8b63\",\n          \"message\": \"Added code for deleting directory\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:15:47Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:15:47Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"e5f6efbb72902997353580ee56b7893c64452165\",\n          \"message\": \"Added delete code for template\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:32:35Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-22T04:32:35Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"6d89d4f3c84b1f743d93d3b1f6cf70472e1866e5\",\n          \"message\": \"Merge pull request #19 from potion/update-voice-clone-23-05\\n\\nUpdate voice clone 23 05\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-27T04:50:28Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-06-27T04:50:28Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a92f32ac694e18e19b2676847387a215d05e01ea\",\n          \"message\": \"Merge branch 'staging' into develop-07-08\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T08:03:54Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T08:03:54Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"1bd4b8d3039d8a1e2ac02476bec235da829c5b5c\",\n          \"message\": \"Merge branch 'staging' into develop-07-08\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T08:05:02Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T08:05:02Z\"\n          }\n        }\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/25\",\n65:        \"path\": \"voice-cloning-job-handler/index.js\",\n{\n  \"number\": 25,\n  \"title\": \"Added code for cloning script\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/25\",\n  \"createdAt\": \"2023-08-07T08:21:11Z\",\n  \"mergedAt\": \"2023-08-07T08:21:18Z\",\n  \"closedAt\": \"2023-08-07T08:21:18Z\",\n  \"additions\": 2,\n  \"deletions\": 2,\n  \"changedFiles\": 1,\n  \"isDraft\": false,\n  \"baseRefName\": \"develop\",\n  \"headRefName\": \"develop-07-08-updates\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"1c59012333173eba76cec6325608024beb1a669a\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"a3afe89e0e4289c33044e3b9401a5d0bda2be401\",\n          \"message\": \"Added code for cloning script\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T08:20:41Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T08:20:41Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/26\",\n65:        \"path\": \"voice-cloning-job-handler/index.js\",\n{\n  \"number\": 26,\n  \"title\": \"Added changes for sr 48000\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/26\",\n  \"createdAt\": \"2023-08-07T10:19:45Z\",\n  \"mergedAt\": \"2023-08-07T10:19:55Z\",\n  \"closedAt\": \"2023-08-07T10:19:55Z\",\n  \"additions\": 1,\n  \"deletions\": 1,\n  \"changedFiles\": 1,\n  \"isDraft\": false,\n  \"baseRefName\": \"develop\",\n  \"headRefName\": \"develop-07-08-updates\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"6defbb0bb874390f1b1b51b1e20355890c530493\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"ea4608475587cea4615a4980bc767708a186d57e\",\n          \"message\": \"Added changes for sr 48000\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T10:17:46Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-08-07T10:17:58Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/27\",\n69:        \"path\": \"voice-cloning-job-handler/index.js\",\n{\n  \"number\": 27,\n  \"title\": \"updated model name\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/27\",\n  \"createdAt\": \"2023-10-11T20:46:31Z\",\n  \"mergedAt\": \"2023-10-11T20:47:05Z\",\n  \"closedAt\": \"2023-10-11T20:47:05Z\",\n  \"additions\": 2,\n  \"deletions\": 2,\n  \"changedFiles\": 1,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"develop\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_7\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"7fdfc74c03cab06856eff2fac1ec470f40eb64ad\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": [\n      {\n        \"login\": \"author_6\"\n      }\n    ]\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"040f8565569ff7d324db918f17e5aabfb15ba4ca\",\n          \"message\": \"updated model name\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-10-11T20:36:39Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-10-11T20:36:39Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/28\",\n233:          \"message\": \"New cloning approach with termination condition based on speaker similarity and voice naturalness scores.\",\n297:          \"message\": \"48k Voice cloning documentation now based on clone_voice_via_continue_n_natqa.py; adjusted default cloning parameters.\",\n417:        \"path\": \"voice-cloning/clone_voice_via_continue.py\",\n423:        \"path\": \"voice-cloning/clone_voice_via_continue_n_natqa.py\",\n429:        \"path\": \"voice-cloning/docs/Voice Cloning @ 48k Hz Sampling Rate - Step-by-Step.txt\",\n435:        \"path\": \"voice-cloning/docs/potion-voice-cloning_Installation_Guide.md\",\n441:        \"path\": \"voice-cloning/find_best_cloned_model.py\",\n447:        \"path\": \"voice-cloning/find_best_multispeaker_model.py\",\n453:        \"path\": \"voice-cloning/prepare_datasets.py\",\n459:        \"path\": \"voice-cloning/save_multispeaker_baseline_embeddings_file.py\",\n465:        \"path\": \"voice-cloning/synthesize_speech.py\",\n471:        \"path\": \"voice-cloning/train_config.py\",\n477:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n483:        \"path\": \"voice-cloning/train_speaker_encoder.py\",\n489:        \"path\": \"voice-cloning/utils/scoring_utils.py\",\n495:        \"path\": \"voice-cloning/utils/speaker_encoder_utils.py\",\n501:        \"path\": \"voice-cloning/utils/trainer_utils.py\",\n{\n  \"number\": 28,\n  \"title\": \"GCP support, upgraded TTS, new model with cleaner data\",\n  \"body\": \"\",\n  \"state\": \"OPEN\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/28\",\n  \"createdAt\": \"2023-11-29T07:42:08Z\",\n  \"mergedAt\": null,\n  \"closedAt\": null,\n  \"additions\": 1816,\n  \"deletions\": 283,\n  \"changedFiles\": 15,\n  \"isDraft\": false,\n  \"baseRefName\": \"staging\",\n  \"headRefName\": \"develop\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"8615798d7f85f3f29ce99973f97bd9071f76f05b\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 23,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"ad31e02f2a39af5e40fbefe30483e5d8119346b4\",\n          \"message\": \"Added GCP support details and revised config settings for 48k Hz sampling rate usage with TTS v0.20.6\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-11-23T08:45:24Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-11-23T08:45:24Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c41b76ff84f69f00ebfdb1bfbea6c40b0c2529bd\",\n          \"message\": \"Richer config settings (added sampling rate-based configs) and updated training settings.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-19T08:36:49Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-19T08:36:49Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"fdf7496764cff1f7f754175b121d1eec5fce285b\",\n          \"message\": \"Improved error handling and robustness; added support for FLAC files - VCTK v0.92 preprocessing.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T08:00:56Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T08:00:56Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"55886541d20ef9be247610cf616f0167842ca8de\",\n          \"message\": \"Add support for 24k sampling rate.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T08:33:31Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T08:33:31Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"bf4d4c9b215894810755bcd9deb1d6a980c408cc\",\n          \"message\": \"Improved for directory name in extract_archive\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T09:08:51Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T09:08:51Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"90bf857da5add6b341a5514d13bc2a144b8a542c\",\n          \"message\": \"Bug fix in extract_archive\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T09:35:56Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T09:35:56Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"cd968b26a2214cb241a4b660f80c360493a38493\",\n          \"message\": \"Support VCTK v0.92 _mic[12] naming convention.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T12:43:27Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T12:43:27Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"c5abb3269df3c7e4d828ba019907ac0356349fd3\",\n          \"message\": \"Rename wav_dir to audio_dir and correct function call arguments.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T13:58:09Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T13:58:09Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"334aef03182d954606bf2dd6907a30f380ecc0dd\",\n          \"message\": \"Verify that after extraction the dataset root and its audio and transcription file directories are identified correctly.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T15:31:18Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T15:31:18Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"41fa5ff5a72366fb7466445c79dad5c8fd5ec598\",\n          \"message\": \"Improved quality assurance: Ensure that each speaker had transcriptions with matching audio files and vice versa.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T17:32:04Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2023-12-27T17:32:04Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"2e33a79e0465e5fb13f22b6fee2e1f54178860d9\",\n          \"message\": \"fixups and added support for training merged, VCTK-formatted datasets.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T03:26:07Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T03:26:07Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"b0a3c294729107b780d941dfc4d0930b055b187c\",\n          \"message\": \"Added support for training merged, VCTK-formatted datasets.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T03:26:37Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T03:26:37Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"2d7adac5070bd308eba84c7dc193b6c5b5effaa2\",\n          \"message\": \"New cloning approach with termination condition based on speaker similarity and voice naturalness scores.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T03:27:39Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T03:27:39Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"6161686a58dd16505b59107c406ff759eaf02e71\",\n          \"message\": \"Added minimum scoring thresholds for speaker similarity and naturalness; updated scoring parameters.\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T06:28:07Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2024-01-10T06:28:07Z\"\n          }\n        }\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/3\",\n65:        \"path\": \"voice-cloning/clone_voice.py\",\n71:        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n{\n  \"number\": 3,\n  \"title\": \"Further coquai/TTS v0.6.2 compatibiliuty changes\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/3\",\n  \"createdAt\": \"2022-04-21T14:56:26Z\",\n  \"mergedAt\": \"2022-04-21T14:56:32Z\",\n  \"closedAt\": \"2022-04-21T14:56:32Z\",\n  \"additions\": 2,\n  \"deletions\": 2,\n  \"changedFiles\": 2,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"initialCommit\",\n  \"author\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_unknown\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"113758f7434d36f7d090959adb5430abd2d1159e\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"c81a01c209362a2a4e092e2e1cb848a9e14eddfa\",\n          \"message\": \"Further coquai/TTS v0.6.2 compatibiliuty changes\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T14:55:40Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-21T14:55:40Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": []\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning/clone_voice.py\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning/train_multispeaker_baseline_model.py\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}3:  \"title\": \"Feature 4023 voice clone handler\",\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/4\",\n15:  \"headRefName\": \"feature-4023-voice-clone-handler\",\n57:          \"message\": \"Added base code for voice cloning\",\n121:          \"message\": \"Added code for voice synthesizer\",\n361:          \"message\": \"Merge branch 'main' into feature-4023-voice-clone-handler\",\n505:          \"message\": \"Merge branch 'main' into feature-4023-voice-clone-handler\",\n601:          \"message\": \"Merge branch 'feature-4023-voice-clone-handler' of https://github.com/potion/potion-voice into feature-4023-voice-clone-handler\",\n633:          \"message\": \"Update clone_voice.py\",\n649:          \"message\": \"Fixed error for userId\",\n743:        \"path\": \"app/services/voice_cloning/index.js\",\n749:        \"path\": \"app/services/voice_cloning/voice_cloning_model.js\",\n755:        \"path\": \"app/services/voice_cloning/voice_cloning_service.js\",\n773:        \"path\": \"voice-cloning-job-handler/index.js\",\n779:        \"path\": \"voice-cloning-job-handler/package-lock.json\",\n785:        \"path\": \"voice-cloning-job-handler/package.json\",\n791:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n797:        \"path\": \"voice-cloning-job-handler/user_audio_profile/index.js\",\n803:        \"path\": \"voice-cloning-job-handler/user_audio_profile/user_audio_profile_model.js\",\n809:        \"path\": \"voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\",\n815:        \"path\": \"voice-cloning-job-handler/voice_cloning/index.js\",\n821:        \"path\": \"voice-cloning-job-handler/voice_cloning/voice_cloning_model.js\",\n827:        \"path\": \"voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\",\n833:        \"path\": \"voice-cloning/clone_voice.py\",\n839:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n845:        \"path\": \"voice-synthsizer-job-handler/job/index.js\",\n851:        \"path\": \"voice-synthsizer-job-handler/job/job_model.js\",\n857:        \"path\": \"voice-synthsizer-job-handler/job/job_service.js\",\n863:        \"path\": \"voice-synthsizer-job-handler/package-lock.json\",\n869:        \"path\": \"voice-synthsizer-job-handler/package.json\",\n875:        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n881:        \"path\": \"voice-synthsizer-job-handler/recording/index.js\",\n887:        \"path\": \"voice-synthsizer-job-handler/recording/recording_model.js\",\n893:        \"path\": \"voice-synthsizer-job-handler/salutation/index.js\",\n899:        \"path\": \"voice-synthsizer-job-handler/salutation/salutation_model.js\",\n905:        \"path\": \"voice-synthsizer-job-handler/salutation/salutation_service.js\",\n911:        \"path\": \"voice-synthsizer-job-handler/user_audio_profile/index.js\",\n917:        \"path\": \"voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_model.js\",\n923:        \"path\": \"voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\",\n{\n  \"number\": 4,\n  \"title\": \"Feature 4023 voice clone handler\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/4\",\n  \"createdAt\": \"2022-06-06T15:36:08Z\",\n  \"mergedAt\": \"2022-07-19T07:21:41Z\",\n  \"closedAt\": \"2022-07-19T07:21:41Z\",\n  \"additions\": 6450,\n  \"deletions\": 2,\n  \"changedFiles\": 40,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"feature-4023-voice-clone-handler\",\n  \"author\": {\n    \"login\": \"author_6\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"198aadfae502ee2c24eb4d32a93439e47067f9ff\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 40,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"485e9915301bf4fe864029b0b2a391f0d2339d29\",\n          \"message\": \"Updated git ignore file\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-27T21:49:22Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-27T21:49:22Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"1f70cf87c2c13455add0c56af95ab5a2211e7942\",\n          \"message\": \"Added base code for voice cloning\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-27T21:51:05Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-04-27T21:51:05Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"9133eb39182721fd3847d97bd656a10b6346b4d0\",\n          \"message\": \"Added code for db update and status update\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T18:39:00Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T18:39:00Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"8478a51640fc5744711c183ba5aabb6ed3cf1d55\",\n          \"message\": \"Added salutation service and imported s3 model\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T18:44:39Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T18:44:39Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"0878a129ce1f7fb77085ddbe018ccb6424bc11d2\",\n          \"message\": \"Updated the sqs code\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T19:00:24Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T19:00:24Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d6a2d6c761b94a758f9e2d0f03a759da5be52fd5\",\n          \"message\": \"Added code for voice synthesizer\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T19:25:03Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-10T19:25:03Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"79bf6fde2abfd7063bc3a1ff1c2dce5b42e8eada\",\n          \"message\": \"Added code for db connect\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:34:15Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:34:15Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d5c037a7257f39ba1767b5b0ac6ec18b8c34ea92\",\n          \"message\": \"Updated command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:39:32Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:39:32Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"569a2484dabd73b7a1b812540f8723bb8423fb01\",\n          \"message\": \"Updated command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:46:35Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:46:35Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"d6a1af1063e12d9b073163a4296dd9f04546d535\",\n          \"message\": \"Updated command\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:59:30Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T10:59:30Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"84e63f580b72956a97c27fa6d9d41d6a147991a5\",\n          \"message\": \"fixed bug\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T17:50:16Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T17:50:16Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"f726bf5cb38d0da590f51468b0ce3be275e17c88\",\n          \"message\": \"Added changes for log utils\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T17:59:29Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T17:59:29Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"3271a7075ae1b1734faad3fe4cdc45fffffd3a3e\",\n          \"message\": \"Updated the logger object usage\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T18:06:41Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-12T18:06:41Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"35cf55c62186b425fc6380706d36967ed714a57d\",\n          \"message\": \"fixed db issue\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-25T06:50:15Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-05-25T06:50:15Z\"\n          }\n        }\n6:  \"url\": \"https://github.com/potion/potion-voice/pull/5\",\n65:        \"url\": \"https://github.com/potion/potion-voice/pull/5#pullrequestreview-1058152207\",\n78:        \"path\": \"voice-cloning-job-handler/index.js\",\n{\n  \"number\": 5,\n  \"title\": \"Added the filename fix\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/5\",\n  \"createdAt\": \"2022-07-25T08:52:45Z\",\n  \"mergedAt\": \"2022-08-02T05:49:56Z\",\n  \"closedAt\": \"2022-08-02T05:49:56Z\",\n  \"additions\": 8,\n  \"deletions\": 2,\n  \"changedFiles\": 1,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"hotfix-update-filename\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"cd472f8ee9a500461672acece889b02bb3a8e84f\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"470e8e7b3012a7e39755f8e3e9de3eb0a257406a\",\n          \"message\": \"Added the filename fix\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-07-25T08:52:19Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-07-25T08:52:19Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2022-08-02T05:49:50Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/5#pullrequestreview-1058152207\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 8,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/6\",\n65:        \"url\": \"https://github.com/potion/potion-voice/pull/6#pullrequestreview-1197567560\",\n78:        \"path\": \"voice-cloning-job-handler/index.js\",\n84:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n90:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n{\n  \"number\": 6,\n  \"title\": \"Updated the cloud front access and code\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/6\",\n  \"createdAt\": \"2022-11-29T13:22:59Z\",\n  \"mergedAt\": \"2022-11-29T13:35:23Z\",\n  \"closedAt\": \"2022-11-29T13:35:23Z\",\n  \"additions\": 26,\n  \"deletions\": 3,\n  \"changedFiles\": 3,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"fix-bucket-access-for-sentences\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"5e5907f8b9099f4b51212ea2b4615cc2b48f3dc8\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"972fa9e89c08cbd799230eab43b80c9a7f80f0ce\",\n          \"message\": \"Updated the cloudfront access and code\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-11-29T13:22:35Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-11-29T13:22:35Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2022-11-29T13:35:16Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/6#pullrequestreview-1197567560\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 18,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n        \"additions\": 4,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n        \"additions\": 4,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/7\",\n65:        \"url\": \"https://github.com/potion/potion-voice/pull/7#pullrequestreview-1197714881\",\n78:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n84:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n{\n  \"number\": 7,\n  \"title\": \"Added change in yml file\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/7\",\n  \"createdAt\": \"2022-11-29T14:51:46Z\",\n  \"mergedAt\": \"2022-11-29T14:52:47Z\",\n  \"closedAt\": \"2022-11-29T14:52:47Z\",\n  \"additions\": 2,\n  \"deletions\": 2,\n  \"changedFiles\": 2,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"fix-bucket-access-for-sentences\",\n  \"author\": {\n    \"login\": \"author_7\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"a1d067c2fa8a813a6d47f7bccfb8d08af3163e23\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 1,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"26e0b4fa32500e73025b8c1c4941deddcceab6da\",\n          \"message\": \"Added change in yml file\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-11-29T14:51:14Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-11-29T14:51:14Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2022-11-29T14:52:40Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/7#pullrequestreview-1197714881\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/8\",\n101:        \"url\": \"https://github.com/potion/potion-voice/pull/8#pullrequestreview-1221040528\",\n126:        \"path\": \"voice-cloning-job-handler/index.js\",\n132:        \"path\": \"voice-cloning-job-handler/package.json\",\n138:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n144:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n150:        \"path\": \"voice-cloning-job-handler/yarn.lock\",\n156:        \"path\": \"voice-synthsizer-job-handler/index.js\",\n162:        \"path\": \"voice-synthsizer-job-handler/package.json\",\n168:        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n174:        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n180:        \"path\": \"voice-synthsizer-job-handler/yarn.lock\",\n{\n  \"number\": 8,\n  \"title\": \"updated mongoose version 6.x\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/8\",\n  \"createdAt\": \"2022-12-16T15:03:54Z\",\n  \"mergedAt\": \"2022-12-16T15:31:52Z\",\n  \"closedAt\": \"2022-12-16T15:31:52Z\",\n  \"additions\": 6351,\n  \"deletions\": 23,\n  \"changedFiles\": 13,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"PR-update-mongoose-version-to-6.x\",\n  \"author\": {\n    \"login\": \"author_9\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"89ba7c08942ecb39cfc90d447d142e8d9fd8a3dc\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": [\n      {\n        \"login\": \"author_7\"\n      }\n    ]\n  },\n  \"commits\": {\n    \"totalCount\": 3,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"c31772f5c452adfad9548001d5bd44409054f6c6\",\n          \"message\": \"updated mongoose version 6.x\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-16T15:03:22Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-16T15:03:22Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"a444056854eaea7ad553e643e49953ac9792e54f\",\n          \"message\": \"update development mongo uri\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-16T15:15:25Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-16T15:15:25Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"ad1ade5bd3c480591490118c644059dabf5d46cf\",\n          \"message\": \"update dev/staging mongo uri\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-16T15:26:26Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-16T15:26:26Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2022-12-16T15:31:43Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/8#pullrequestreview-1221040528\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \".prettierrc\",\n        \"additions\": 7,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"package.json\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/index.js\",\n        \"additions\": 2,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/package.json\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/yarn.lock\",\n        \"additions\": 2475,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/index.js\",\n        \"additions\": 2,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/package.json\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n        \"additions\": 5,\n        \"deletions\": 6,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n        \"additions\": 6,\n        \"deletions\": 7,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/yarn.lock\",\n        \"additions\": 1371,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      },\n      {\n        \"path\": \"yarn.lock\",\n        \"additions\": 2475,\n        \"deletions\": 0,\n        \"changeType\": \"ADDED\"\n      }\n    ]\n  }\n}6:  \"url\": \"https://github.com/potion/potion-voice/pull/9\",\n81:        \"url\": \"https://github.com/potion/potion-voice/pull/9#pullrequestreview-1242087312\",\n94:        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n100:        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n106:        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n112:        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n{\n  \"number\": 9,\n  \"title\": \"update DB uri\",\n  \"body\": \"\",\n  \"state\": \"MERGED\",\n  \"url\": \"https://github.com/potion/potion-voice/pull/9\",\n  \"createdAt\": \"2022-12-19T11:00:51Z\",\n  \"mergedAt\": \"2023-01-10T12:12:57Z\",\n  \"closedAt\": \"2023-01-10T12:12:57Z\",\n  \"additions\": 6,\n  \"deletions\": 6,\n  \"changedFiles\": 4,\n  \"isDraft\": false,\n  \"baseRefName\": \"main\",\n  \"headRefName\": \"update-db-uri\",\n  \"author\": {\n    \"login\": \"author_9\"\n  },\n  \"mergedBy\": {\n    \"login\": \"author_6\"\n  },\n  \"mergeCommit\": {\n    \"oid\": \"7708b1a13f89398c7718d1b39eae1271a1c9df40\"\n  },\n  \"milestone\": null,\n  \"labels\": {\n    \"nodes\": []\n  },\n  \"assignees\": {\n    \"nodes\": []\n  },\n  \"requestedReviewers\": {\n    \"nodes\": []\n  },\n  \"commits\": {\n    \"totalCount\": 2,\n    \"nodes\": [\n      {\n        \"commit\": {\n          \"oid\": \"391d1d181208264195773de717e9be058e9fe471\",\n          \"message\": \"update DB uri\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-19T11:00:25Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-19T11:00:25Z\"\n          }\n        }\n      },\n      {\n        \"commit\": {\n          \"oid\": \"6c444d38397251f3c7d1ea7eb919bdb57df8eb7e\",\n          \"message\": \"update DB uri\",\n          \"author\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-19T11:04:01Z\"\n          },\n          \"committer\": {\n            \"name\": \"author_unknown\",\n            \"email\": \"author_unknown\",\n            \"date\": \"2022-12-19T11:04:01Z\"\n          }\n        }\n      }\n    ]\n  },\n  \"reviews\": {\n    \"nodes\": [\n      {\n        \"author\": {\n          \"login\": \"author_6\"\n        },\n        \"state\": \"APPROVED\",\n        \"body\": \"\",\n        \"submittedAt\": \"2023-01-10T12:12:51Z\",\n        \"url\": \"https://github.com/potion/potion-voice/pull/9#pullrequestreview-1242087312\",\n        \"comments\": {\n          \"nodes\": []\n        }\n      }\n    ]\n  },\n  \"comments\": {\n    \"nodes\": []\n  },\n  \"files\": {\n    \"nodes\": [\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-development.yml\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-cloning-job-handler/pm2-production.yml\",\n        \"additions\": 2,\n        \"deletions\": 2,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/pm2-development.yml\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      },\n      {\n        \"path\": \"voice-synthsizer-job-handler/pm2-production.yml\",\n        \"additions\": 1,\n        \"deletions\": 1,\n        \"changeType\": \"MODIFIED\"\n      }\n    ]\n  }\n}","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_22","type":"command_execution","command":"/bin/bash -lc \"for f in .styx_prs/*.json; do jq -r '[.number,.title,.body] | @tsv' \\\"\"'$f\"; done | sort -n'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_22","type":"command_execution","command":"/bin/bash -lc \"for f in .styx_prs/*.json; do jq -r '[.number,.title,.body] | @tsv' \\\"\"'$f\"; done | sort -n'","aggregated_output":"1\tInitial commit\t\n2\tInitial commit\tAdditional improvements for initial commit (coqiau/TTS v0.6.2 compatibility)\n3\tFurther coquai/TTS v0.6.2 compatibiliuty changes\t\n4\tFeature 4023 voice clone handler\t\n5\tAdded the filename fix\t\n6\tUpdated the cloud front access and code\t\n7\tAdded change in yml file\t\n8\tupdated mongoose version 6.x\t\n9\tupdate DB uri\t\n10\tupdated code for using original text\t\n11\tVoice ai v2 changes\t\n12\tAi 490 adv synth\tAdded:\\r\\n+ optional speech sample waveform and text parameter support for style transfer\\r\\n+ upsampling of synthetic speech output to target sampling rate (48kHz by default)\\r\\n\\r\\nUpdated:\\r\\n+ usage documentation\n13\tAdded sr48000 for wave\t\n14\tNew feature score model\tNo impact on staging / prod ... just for dev / training.\n15\tNew feature score model\tImproved and documented the new find_best_* model scripts.\n16\tStaging > Main\t\n17\tNew feature updates\t\n18\tRefined voice cloning settings\tUpdate settings for voice cloning.\n19\tUpdate voice clone 23 05\t\n20\tStaging > Main\t\n21\tDev find best fixup\tfind_best_* improvements (suppress TTS-based command line output; track progress instead)\n22\tDev cpu only\tCPU-only processing support (tested)\n23\tDevelop\tSupport of 48k Hz sampling rate as default; GPU and CPU-based usage for all scripts but baseline training run.\\r\\n\\r\\nSee voice-cloning/docs/Voice\\\\ Cloning\\\\ @\\\\ 48k\\\\ Hz\\\\ Sampling\\\\ Rate\\\\ -\\\\ Step-by-Step.txt for example usage.\\r\\n\\r\\nModel assets can be found at s3://potion-ai-models/potion-voice-2023-08/\n24\tDevelop 07 08 code updates\t\n25\tAdded code for cloning script\t\n26\tAdded changes for sr 48000\t\n27\tupdated model name\t\n28\tGCP support, upgraded TTS, new model with cleaner data\t\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_23","type":"command_execution","command":"/bin/bash -lc 'node --version && npm --version && npm ls --depth=0'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_23","type":"command_execution","command":"/bin/bash -lc 'node --version && npm --version && npm ls --depth=0'","aggregated_output":"v14.21.3\n6.14.18\npotion-voice@1.0.0 /workspace\n├── @bugsnag/js@7.16.2\n├── aws-code-deploy@1.0.11\n├── aws-sdk@2.1134.0\n├── fs-extra@9.1.0\n├── mongoose@6.13.11\n├── pm2@5.2.0\n├── rimraf@3.0.2\n└── uuid@8.3.2\n\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_24","type":"agent_message","text":"I’m applying a fail-closed pattern: validate the tenant and document IDs from each message, authorize every referenced record with `{_id, userId}`, and make mutation helpers require that same tenant scope. Rejected messages will be acknowledged and contained without terminating the polling loop."}}
{"type":"item.started","item":{"id":"item_25","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_25","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_26","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_26","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_27","type":"command_execution","command":"/bin/bash -lc \"sed -n '80,360p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_27","type":"command_execution","command":"/bin/bash -lc \"sed -n '80,360p' index.js\"","aggregated_output":"      // console.log('Stdout --- ', stdout)\n      // console.log('Stderror --- ', stderr)\n      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n\n      resolve()\n    })\n  })\n}\n\nasync function getFile(waveUrl, path) {\n  return new Promise((resolve) => {\n    https.get(waveUrl, (res) => {\n      const writeStream = fs.createWriteStream(path)\n\n      res.pipe(writeStream)\n\n      writeStream.on('finish', () => {\n        writeStream.close()\n        resolve()\n      })\n    })\n  })\n}\n\nfunction pad(s) {\n  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n  return s\n}\n\nconst processQueue = () => {\n  /* eslint-disable no-async-promise-executor */\n  return new Promise(async (resolve, reject) => {\n    try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const job = JSON.parse(response.Messages[0].Body)\n        const receiptHandle = response.Messages[0].ReceiptHandle\n        console.log('job===', job)\n\n        const { metadata, input, _id, userAudioProfileId } = job._doc\n        console.log('userAudioProfileId', userAudioProfileId)\n        console.log('_id', _id)\n        const { env } = job\n        console.log('env', env)\n\n        console.log('metadata------', metadata)\n        console.log('input', input)\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        const cloudFrontUrl =\n          env === 'production'\n            ? cloudFrontUrlProd\n            : env === 'staging'\n            ? cloudFrontUrlStaging\n            : cloudFrontUrlDev\n\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n\n          const { directoryName } = metadata\n          console.log('directoryName', directoryName)\n          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n          if (!fs.existsSync(logPath)) {\n            fs.mkdirSync(logPath, { recursive: true })\n          }\n          // update the db model to processing\n          await voiceCloningService.update({ _id, status: 'processing' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'processing',\n          })\n\n          // create directory for userid-useraudioprofileid if not exist\n          const rootPath = `/tmp/${directoryName}`\n          const wavePath = `${rootPath}/wav48/1`\n          if (!fs.existsSync(wavePath)) {\n            fs.mkdirSync(wavePath, { recursive: true })\n          }\n\n          const txtPath = `${rootPath}/txt/1`\n          if (!fs.existsSync(txtPath)) {\n            fs.mkdirSync(txtPath, { recursive: true })\n          }\n          // download the training data files and put it in respective directories\n          for (let index = 0; index < input.length; index++) {\n            const item = input[index]\n\n            const { waveUrl, originalText } = item\n            // download wave file\n            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n\n            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n\n            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n            await fs.promises.writeFile(txtFilePath, originalText)\n          }\n\n          const zipFileName = directoryName + '.tgz'\n\n          // /tmp/directoryName.tgz\n\n          await execShellCommand(\n            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n            logPath\n          )\n          console.log('ZIP created ', zipFileName)\n\n          // re-sample audio\n          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n          console.time(SAMPLING_LABEL)\n\n          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n\n          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n          console.log('samplingCommand ', samplingCommand)\n          const samplingResponse = await execShellCommand(\n            samplingCommand,\n            logPath\n          )\n          console.timeEnd(SAMPLING_LABEL)\n\n          // /mnt/efs/potion-voice/${env}/speakrs.pth\n          // /mnt/efs/potion-voice/${env}/txt\n          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n\n          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n\n          const resultsPath = outPath + '/results'\n\n          //update pth file for cloning\n          // clone the voice\n          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n          console.time(VOICE_CLONING_LABEL)\n          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n            outPath + '/speakers.pth'\n          } --output_path ${resultsPath}`\n\n          console.log('Training Model Command', trainingModelCommand)\n          const trainingResponse = await execShellCommand(\n            trainingModelCommand,\n            logPath\n          )\n\n          console.timeEnd(VOICE_CLONING_LABEL)\n\n          let generatedDirectoryName = ''\n          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n            if (file.includes('vits_potion_clone'))\n              // use output from above to get right path and directory name\n              generatedDirectoryName = file\n          })\n\n          // minimize cloning model\n          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n          console.time(VOICE_MINIMIZE_LABEL)\n          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n            resultsPath + '/' + generatedDirectoryName + '/'\n          } --voice_model_name checkpoint_365200.pth`\n\n          console.log(\n            'Minimize Cloning Model Command',\n            minimizeCloningModelCommand\n          )\n          const minimizeCloning = await execShellCommand(\n            minimizeCloningModelCommand,\n            logPath\n          )\n          console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n          // Add the  code to update location of generated model and status into DB\n          await voiceCloningService.update({ _id, status: 'completed' })\n\n          const training_model_path = {\n            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n          }\n\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'completed',\n            training_model_path,\n          })\n\n          // add code to put that model into S3\n          let keys = Object.keys(training_model_path)\n\n          const training_model_s3_path = {}\n\n          for (let index = 0; index < keys.length; index++) {\n            const path = training_model_path[keys[index]]\n            const s3Path = await s3.upload({\n              filePath: path,\n              fileName: `${directoryName}/${path.split('/').pop()}`,\n              bucket: `potion-voice-users-training-model/${env}`,\n            })\n            training_model_s3_path[keys[index]] = s3Path\n          }\n          //  add S3 path to user audio profile model\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            training_model_s3_path,\n          })\n        } catch (error) {\n          console.log('error********************', error)\n          Bugsnag.notify(\n            new Error(\n              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n            )\n          )\n          Bugsnag.notify(error)\n\n          // update the db to set status as error\n          await voiceCloningService.update({ _id, status: 'error' })\n          await userAudioProfileService.update({\n            _id: userAudioProfileId,\n            status: 'error',\n          })\n\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while training voice clone', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  console.log('potion Voice Clone Process Started')\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_28","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_28","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_29","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_29","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_30","type":"command_execution","command":"/bin/bash -lc \"node --check index.js && sed -n '105,380p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_30","type":"command_execution","command":"/bin/bash -lc \"node --check index.js && sed -n '105,380p' index.js\"","aggregated_output":"function pad(s) {\n  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n  return s\n}\n\nconst processQueue = async () => {\n  try {\n      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n      if (\n        typeof response.Messages !== 'undefined' &&\n        response.Messages.length > 0\n      ) {\n        throttleMessageFetching = false\n        const message = response.Messages[0]\n        await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n\n        const job = JSON.parse(message.Body)\n        console.log('job===', job)\n\n        const { metadata, input, _id, userAudioProfileId, userId, env } =\n          getJobContext(job)\n        console.log('userAudioProfileId', userAudioProfileId)\n        console.log('_id', _id)\n        console.log('env', env)\n\n        console.log('metadata------', metadata)\n        console.log('input', input)\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        const [voiceCloningJob, userAudioProfile] = await Promise.all([\n          voiceCloningService.read({\n            _id,\n            userId,\n            userAudioProfileId,\n          }),\n          userAudioProfileService.read({\n            _id: userAudioProfileId,\n            userId,\n          }),\n        ])\n\n        if (!voiceCloningJob || !userAudioProfile) {\n          throw new RejectedJobError(\n            'Voice cloning job does not belong to the supplied userId'\n          )\n        }\n\n        const cloudFrontUrl =\n          env === 'production'\n            ? cloudFrontUrlProd\n            : env === 'staging'\n            ? cloudFrontUrlStaging\n            : cloudFrontUrlDev\n\n        try {\n          const { directoryName } = metadata\n          console.log('directoryName', directoryName)\n          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n          if (!fs.existsSync(logPath)) {\n            fs.mkdirSync(logPath, { recursive: true })\n          }\n          // update the db model to processing\n          await voiceCloningService.update(\n            { _id, status: 'processing' },\n            userId\n          )\n          await userAudioProfileService.update(\n            {\n              _id: userAudioProfileId,\n              status: 'processing',\n            },\n            userId\n          )\n\n          // create directory for userid-useraudioprofileid if not exist\n          const rootPath = `/tmp/${directoryName}`\n          const wavePath = `${rootPath}/wav48/1`\n          if (!fs.existsSync(wavePath)) {\n            fs.mkdirSync(wavePath, { recursive: true })\n          }\n\n          const txtPath = `${rootPath}/txt/1`\n          if (!fs.existsSync(txtPath)) {\n            fs.mkdirSync(txtPath, { recursive: true })\n          }\n          // download the training data files and put it in respective directories\n          for (let index = 0; index < input.length; index++) {\n            const item = input[index]\n\n            const { waveUrl, originalText } = item\n            // download wave file\n            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n\n            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n\n            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n            await fs.promises.writeFile(txtFilePath, originalText)\n          }\n\n          const zipFileName = directoryName + '.tgz'\n\n          // /tmp/directoryName.tgz\n\n          await execShellCommand(\n            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n            logPath\n          )\n          console.log('ZIP created ', zipFileName)\n\n          // re-sample audio\n          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n          console.time(SAMPLING_LABEL)\n\n          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n\n          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n          console.log('samplingCommand ', samplingCommand)\n          const samplingResponse = await execShellCommand(\n            samplingCommand,\n            logPath\n          )\n          console.timeEnd(SAMPLING_LABEL)\n\n          // /mnt/efs/potion-voice/${env}/speakrs.pth\n          // /mnt/efs/potion-voice/${env}/txt\n          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n\n          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n\n          const resultsPath = outPath + '/results'\n\n          //update pth file for cloning\n          // clone the voice\n          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n          console.time(VOICE_CLONING_LABEL)\n          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n            outPath + '/speakers.pth'\n          } --output_path ${resultsPath}`\n\n          console.log('Training Model Command', trainingModelCommand)\n          const trainingResponse = await execShellCommand(\n            trainingModelCommand,\n            logPath\n          )\n\n          console.timeEnd(VOICE_CLONING_LABEL)\n\n          let generatedDirectoryName = ''\n          fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n            if (file.includes('vits_potion_clone'))\n              // use output from above to get right path and directory name\n              generatedDirectoryName = file\n          })\n\n          // minimize cloning model\n          const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n          console.time(VOICE_MINIMIZE_LABEL)\n          const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n            resultsPath + '/' + generatedDirectoryName + '/'\n          } --voice_model_name checkpoint_365200.pth`\n\n          console.log(\n            'Minimize Cloning Model Command',\n            minimizeCloningModelCommand\n          )\n          const minimizeCloning = await execShellCommand(\n            minimizeCloningModelCommand,\n            logPath\n          )\n          console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n          // Add the  code to update location of generated model and status into DB\n          await voiceCloningService.update(\n            { _id, status: 'completed' },\n            userId\n          )\n\n          const training_model_path = {\n            voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n            voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n            voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n            voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n            voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n          }\n\n          await userAudioProfileService.update(\n            {\n              _id: userAudioProfileId,\n              status: 'completed',\n              training_model_path,\n            },\n            userId\n          )\n\n          // add code to put that model into S3\n          let keys = Object.keys(training_model_path)\n\n          const training_model_s3_path = {}\n\n          for (let index = 0; index < keys.length; index++) {\n            const path = training_model_path[keys[index]]\n            const s3Path = await s3.upload({\n              filePath: path,\n              fileName: `${directoryName}/${path.split('/').pop()}`,\n              bucket: `potion-voice-users-training-model/${env}`,\n            })\n            training_model_s3_path[keys[index]] = s3Path\n          }\n          //  add S3 path to user audio profile model\n          await userAudioProfileService.update(\n            {\n              _id: userAudioProfileId,\n              training_model_s3_path,\n            },\n            userId\n          )\n        } catch (error) {\n          console.log('error********************', error)\n          Bugsnag.notify(\n            new Error(\n              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n            )\n          )\n          Bugsnag.notify(error)\n\n          // Keep failure handling tenant-scoped and do not let a secondary\n          // status update failure stop the polling loop.\n          await Promise.allSettled([\n            voiceCloningService.update({ _id, status: 'error' }, userId),\n            userAudioProfileService.update(\n              {\n                _id: userAudioProfileId,\n                status: 'error',\n              },\n              userId\n            ),\n          ])\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n    } catch (error) {\n      if (error instanceof RejectedJobError) {\n        console.warn('Rejected voice cloning job', { reason: error.message })\n      } else {\n        console.error('Error while training voice clone', { error })\n        Bugsnag.notify(error)\n      }\n    } finally {\n      try {\n        await mongoose.connection.close()\n      } catch (error) {\n        console.error('Error while closing Mongo DB connection', { error })\n        Bugsnag.notify(error)\n      }\n    }\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  console.log('potion Voice Clone Process Started')\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_31","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_31","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_32","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_32","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_33","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_33","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_34","type":"command_execution","command":"/bin/bash -lc \"node --check index.js && sed -n '108,205p' index.js && sed -n '335,390p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_34","type":"command_execution","command":"/bin/bash -lc \"node --check index.js && sed -n '108,205p' index.js && sed -n '335,390p' index.js\"","aggregated_output":"}\n\nconst processQueue = async () => {\n  let message\n  let messageDeleted = false\n\n  try {\n    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n    if (\n      typeof response.Messages !== 'undefined' &&\n      response.Messages.length > 0\n    ) {\n      throttleMessageFetching = false\n      message = response.Messages[0]\n\n      let job\n      try {\n        job = JSON.parse(message.Body)\n      } catch (error) {\n        throw new RejectedJobError('Invalid JSON in voice cloning job')\n      }\n\n        console.log('job===', job)\n\n        const { metadata, input, _id, userAudioProfileId, userId, env } =\n          getJobContext(job)\n        console.log('userAudioProfileId', userAudioProfileId)\n        console.log('_id', _id)\n        console.log('env', env)\n\n        console.log('metadata------', metadata)\n        console.log('input', input)\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        const [voiceCloningJob, userAudioProfile] = await Promise.all([\n          voiceCloningService.read({\n            _id,\n            userId,\n            userAudioProfileId,\n          }),\n          userAudioProfileService.read({\n            _id: userAudioProfileId,\n            userId,\n          }),\n        ])\n\n        if (!voiceCloningJob || !userAudioProfile) {\n          throw new RejectedJobError(\n            'Voice cloning job does not belong to the supplied userId'\n          )\n        }\n\n        await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n        messageDeleted = true\n\n        const cloudFrontUrl =\n          env === 'production'\n            ? cloudFrontUrlProd\n            : env === 'staging'\n            ? cloudFrontUrlStaging\n            : cloudFrontUrlDev\n\n        try {\n          const { directoryName } = metadata\n          console.log('directoryName', directoryName)\n          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n          if (!fs.existsSync(logPath)) {\n            fs.mkdirSync(logPath, { recursive: true })\n          }\n          // update the db model to processing\n          await voiceCloningService.update(\n            { _id, status: 'processing' },\n            userId\n          )\n          await userAudioProfileService.update(\n            {\n              _id: userAudioProfileId,\n              status: 'processing',\n            },\n            userId\n          )\n\n          // create directory for userid-useraudioprofileid if not exist\n          const rootPath = `/tmp/${directoryName}`\n          const wavePath = `${rootPath}/wav48/1`\n          if (!fs.existsSync(wavePath)) {\n            fs.mkdirSync(wavePath, { recursive: true })\n          }\n\n            {\n              _id: userAudioProfileId,\n              training_model_s3_path,\n            },\n            userId\n          )\n        } catch (error) {\n          console.log('error********************', error)\n          Bugsnag.notify(\n            new Error(\n              `Unable to train for voice cloning videos ` + JSON.stringify(job)\n            )\n          )\n          Bugsnag.notify(error)\n\n          // Keep failure handling tenant-scoped and do not let a secondary\n          // status update failure stop the polling loop.\n          await Promise.allSettled([\n            voiceCloningService.update({ _id, status: 'error' }, userId),\n            userAudioProfileService.update(\n              {\n                _id: userAudioProfileId,\n                status: 'error',\n              },\n              userId\n            ),\n          ])\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n    } catch (error) {\n      if (error instanceof RejectedJobError) {\n        if (message && !messageDeleted) {\n          try {\n            await sqs.deleteMessageFromSQS(\n              sqsQueueUrl,\n              message.ReceiptHandle\n            )\n          } catch (deleteError) {\n            console.error('Unable to delete rejected voice cloning job', {\n              error: deleteError,\n            })\n            Bugsnag.notify(deleteError)\n          }\n        }\n        console.warn('Rejected voice cloning job', { reason: error.message })\n      } else {\n        console.error('Error while training voice clone', { error })\n        Bugsnag.notify(error)\n      }\n    } finally {\n      try {\n        await mongoose.connection.close()\n      } catch (error) {\n        console.error('Error while closing Mongo DB connection', { error })\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_35","type":"command_execution","command":"/bin/bash -lc 'test -x node_modules/.bin/prettier && node_modules/.bin/prettier --version || true'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_35","type":"command_execution","command":"/bin/bash -lc 'test -x node_modules/.bin/prettier && node_modules/.bin/prettier --version || true'","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_36","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_36","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_37","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_37","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_38","type":"command_execution","command":"/bin/bash -lc \"sed -n '85,255p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_38","type":"command_execution","command":"/bin/bash -lc \"sed -n '85,255p' index.js\"","aggregated_output":"        const message = response.Messages[0]\n        await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n\n        let job\n        try {\n          job = JSON.parse(message.Body)\n        } catch (error) {\n          throw new RejectedJobError('Invalid JSON in voice synthesizer job')\n        }\n        validateJob(job)\n\n        try {\n          const {\n            userId,\n            userAudioProfileId,\n            text,\n            firstName,\n            salutationId,\n            recordingId,\n            baseUrlForPotionAi,\n            env,\n          } = job\n\n          const DB_URI =\n            env === 'production'\n              ? mongoUriProd\n              : env === 'staging'\n              ? mongoUriStaging\n              : mongoUriDev\n\n          console.log('DB_URI ', DB_URI)\n          await connectDB(DB_URI)\n\n          // read the path for the training model for the this users audio profile\n\n          const userAudioProfile = await userAudioProfileService.find({\n            _id: userAudioProfileId,\n            status: 'completed',\n          })\n          if (userAudioProfile) {\n            const { training_model_path, userId } = userAudioProfile[0]\n            const {\n              voice_model_light_path,\n              voice_model_config_light_path,\n              voice_model_speakers_file_path, // name for speakers embeddings file path\n            } = training_model_path\n\n            const outputPath = `/tmp/${uuid()}/`\n            if (!fs.existsSync(outputPath)) {\n              fs.mkdirSync(outputPath, { recursive: true })\n            }\n\n            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n            console.log('AI_COMMAND ', AI_COMMAND)\n\n            const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n            console.time(SYNTHESIZE_AI_LABEL)\n            const aiResponse = await execShellCommand(AI_COMMAND)\n            console.timeEnd(SYNTHESIZE_AI_LABEL)\n\n            let generatedFileName = ''\n            fs.readdirSync(`${outputPath}`).forEach((file) => {\n              if (file.includes('sr48000.wav')) generatedFileName = file\n            })\n\n            // upload the file to s3\n            const uploadParams = {\n              filePath: `${outputPath}${generatedFileName}`,\n              bucket: `recordings-${env}`,\n              fileName: `${uuid()}_salutation_${firstName.replace(\n                '-',\n                '_'\n              )}.wav`,\n              contentType: 'audio/x-wav',\n              fileType: 'wav',\n            }\n            console.time('Time to Upload video on S3')\n            const greetingUploadResponse = await s3.upload(uploadParams)\n            console.timeEnd('Time to Upload video on S3')\n\n            // Create new entry with the s3 path to salutation collection for the user and its profile id\n            // upsert the salutation\n            await salutationService.updateOrCreate(\n              {\n                firstName: firstName,\n                salutationVideo: greetingUploadResponse,\n                userAudioProfileId,\n              },\n              userId\n            )\n            // update the dynamic recordings for the current dynamic video with salutation url\n            const salutationToUpdate = await recordingSalutationModel.findOne({\n              _id: salutationId,\n              deleted: false,\n            })\n\n            const recordingToUpdate = await recordingModel.findOne({\n              _id: recordingId,\n              deleted: false,\n            })\n\n            if (\n              salutationToUpdate &&\n              salutationToUpdate.deleted === false &&\n              recordingToUpdate\n            ) {\n              const jobsToInsert = []\n\n              await recordingSalutationModel.findOneAndUpdate(\n                {\n                  _id: salutationId,\n                },\n                {\n                  $set: {\n                    salutationVideo: greetingUploadResponse,\n                  },\n                }\n              )\n\n              const jobData = {\n                originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n                originalVideo:\n                  recordingToUpdate.originalVideoUrl ||\n                  recordingToUpdate.urls[0].url,\n                cropTimestamp: recordingToUpdate.cropTimestamp,\n                greetingClips: [greetingUploadResponse],\n                greetingObjects: [\n                  {\n                    greetingId: salutationToUpdate._id,\n                    firstName: firstName,\n                    videoUrl: greetingUploadResponse,\n                  },\n                ],\n                requestOrigin: baseUrlForPotionAi,\n                environment: env,\n                recordingId: recordingToUpdate._id,\n                salutation: salutationToUpdate._id,\n                dynamicVideoType: recordingToUpdate.dynamicVideoType,\n              }\n              jobsToInsert.push({\n                firstName,\n                recordingId: recordingToUpdate._id,\n                userId: recordingToUpdate.userId,\n                salutationId: salutationToUpdate._id,\n                metadata: jobData,\n              })\n\n              // create the job for the ai to create processing\n              if (jobsToInsert.length) {\n                await jobService.insertMany(jobsToInsert)\n              }\n            }\n\n            fs.unlinkSync(`${outputPath}${generatedFileName}`)\n            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n          } else {\n            Bugsnag.notify(\n              new Error(\n                `audio profile training model not found ` + JSON.stringify(job)\n              )\n            )\n\n            resolve() // to continue working on new jobs\n          }\n        } catch (error) {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n          resolve() // to continue working on new jobs\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_39","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_39","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_40","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_40","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_41","type":"command_execution","command":"/bin/bash -lc \"sed -n '108,285p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_41","type":"command_execution","command":"/bin/bash -lc \"sed -n '108,285p' index.js\"","aggregated_output":"          const DB_URI =\n            env === 'production'\n              ? mongoUriProd\n              : env === 'staging'\n              ? mongoUriStaging\n              : mongoUriDev\n\n          console.log('DB_URI ', DB_URI)\n          await connectDB(DB_URI)\n\n          // read the path for the training model for the this users audio profile\n\n          const userAudioProfile = await userAudioProfileService.read({\n            _id: userAudioProfileId,\n            userId,\n            status: 'completed',\n          })\n          if (userAudioProfile) {\n            const { training_model_path } = userAudioProfile\n\n            const [salutationToUpdate, recordingToUpdate] = await Promise.all([\n              recordingSalutationModel.findOne({\n                _id: salutationId,\n                userId,\n                deleted: false,\n              }),\n              recordingModel.findOne({\n                _id: recordingId,\n                userId,\n                deleted: false,\n              }),\n            ])\n\n            if (!salutationToUpdate || !recordingToUpdate) {\n              throw new RejectedJobError(\n                'Recording data does not belong to the supplied userId'\n              )\n            }\n\n            const {\n              voice_model_light_path,\n              voice_model_config_light_path,\n              voice_model_speakers_file_path, // name for speakers embeddings file path\n            } = training_model_path\n\n            const outputPath = `/tmp/${uuid()}/`\n            if (!fs.existsSync(outputPath)) {\n              fs.mkdirSync(outputPath, { recursive: true })\n            }\n\n            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n            console.log('AI_COMMAND ', AI_COMMAND)\n\n            const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n            console.time(SYNTHESIZE_AI_LABEL)\n            const aiResponse = await execShellCommand(AI_COMMAND)\n            console.timeEnd(SYNTHESIZE_AI_LABEL)\n\n            let generatedFileName = ''\n            fs.readdirSync(`${outputPath}`).forEach((file) => {\n              if (file.includes('sr48000.wav')) generatedFileName = file\n            })\n\n            // upload the file to s3\n            const uploadParams = {\n              filePath: `${outputPath}${generatedFileName}`,\n              bucket: `recordings-${env}`,\n              fileName: `${uuid()}_salutation_${firstName.replace(\n                '-',\n                '_'\n              )}.wav`,\n              contentType: 'audio/x-wav',\n              fileType: 'wav',\n            }\n            console.time('Time to Upload video on S3')\n            const greetingUploadResponse = await s3.upload(uploadParams)\n            console.timeEnd('Time to Upload video on S3')\n\n            // Create new entry with the s3 path to salutation collection for the user and its profile id\n            // upsert the salutation\n            await salutationService.updateOrCreate(\n              {\n                firstName: firstName,\n                salutationVideo: greetingUploadResponse,\n                userAudioProfileId,\n              },\n              userId\n            )\n            // update the dynamic recordings for the current dynamic video with salutation url\n              const jobsToInsert = []\n\n              const updatedRecordingSalutation =\n                await recordingSalutationModel.findOneAndUpdate(\n                {\n                  _id: salutationId,\n                  userId,\n                  deleted: false,\n                },\n                {\n                  $set: {\n                    salutationVideo: greetingUploadResponse,\n                  },\n                },\n                { new: true }\n              )\n\n              if (!updatedRecordingSalutation) {\n                throw new RejectedJobError(\n                  'Recording salutation is no longer available for this userId'\n                )\n              }\n\n              const jobData = {\n                originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n                originalVideo:\n                  recordingToUpdate.originalVideoUrl ||\n                  recordingToUpdate.urls[0].url,\n                cropTimestamp: recordingToUpdate.cropTimestamp,\n                greetingClips: [greetingUploadResponse],\n                greetingObjects: [\n                  {\n                    greetingId: salutationToUpdate._id,\n                    firstName: firstName,\n                    videoUrl: greetingUploadResponse,\n                  },\n                ],\n                requestOrigin: baseUrlForPotionAi,\n                environment: env,\n                recordingId: recordingToUpdate._id,\n                salutation: salutationToUpdate._id,\n                dynamicVideoType: recordingToUpdate.dynamicVideoType,\n              }\n              jobsToInsert.push({\n                firstName,\n                recordingId: recordingToUpdate._id,\n                userId,\n                salutationId: salutationToUpdate._id,\n                metadata: jobData,\n              })\n\n              // create the job for the ai to create processing\n              if (jobsToInsert.length) {\n                await jobService.insertMany(jobsToInsert)\n              }\n\n            fs.unlinkSync(`${outputPath}${generatedFileName}`)\n            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n          } else {\n            Bugsnag.notify(\n              new Error(\n                `audio profile training model not found ` + JSON.stringify(job)\n              )\n            )\n\n            resolve() // to continue working on new jobs\n          }\n        } catch (error) {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n          resolve() // to continue working on new jobs\n        }\n      } else {\n        throttleMessageFetching = true\n      }\n      resolve()\n    } catch (error) {\n      console.error('Error while synthesizing audio', { error })\n      Bugsnag.notify(error)\n      resolve() // to continue working on new jobs\n    } finally {\n      mongoose.connection.close()\n    }\n  })\n}\n\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_42","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_42","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_43","type":"command_execution","command":"/bin/bash -lc 'node --check index.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_43","type":"command_execution","command":"/bin/bash -lc 'node --check index.js'","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_44","type":"agent_message","text":"The live paths are now tenant-bound before any expensive work or cross-record mutation. I’m tightening the adjacent CRUD helpers as well so future handler changes cannot accidentally call `read`, `find`, or delete operations without a `userId`."}}
{"type":"item.started","item":{"id":"item_45","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_45","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_46","type":"command_execution","command":"/bin/bash -lc \"sed -n '20,145p' voice_cloning/voice_cloning_service.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_46","type":"command_execution","command":"/bin/bash -lc \"sed -n '20,145p' voice_cloning/voice_cloning_service.js\"","aggregated_output":"    const inserted = await VoiceCloningModel.insertMany(data)\n    return inserted\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read =\n  (VoiceCloningModel) =>\n  async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to read a voice clone')\n\n    const foundModel = await VoiceCloningModel.findOne({\n      ...filter,\n      userId,\n      deleted: false,\n    })\n    return foundModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find =\n  (VoiceCloningModel) =>\n  async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to find voice clones')\n\n    const foundModels = await VoiceCloningModel.find({\n      ...filter,\n      userId,\n      deleted: false,\n    })\n    return foundModels\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (VoiceCloningModel) => async (data, userId = data.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to update a voice clone')\n\n    const { _id, userId: ignoredUserId, ...updates } = data\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { _id, userId, deleted: false },\n      { $set: updates },\n      {\n        new: true,\n      }\n    )\n\n    return updatedModel\n  } catch (error) {\n    const details = { data }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove =\n  (VoiceCloningModel) =>\n  async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to remove a voice clone')\n\n    const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n      { ...filter, userId },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - VOICE CLONING SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany =\n  (VoiceCloningModel) =>\n  async (filter, userId = filter.userId) => {\n  try {\n    if (!userId)\n      throw new Error('userId is required to remove voice clones')\n\n    const updatedModel = await VoiceCloningModel.updateMany(\n      { ...filter, userId },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedModel\n  } catch (error) {\n    const details = { filter }\n    console.log(\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_47","type":"command_execution","command":"/bin/bash -lc 'node --check voice_cloning/voice_cloning_service.js && node --check user_audio_profile/user_audio_profile_service.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_47","type":"command_execution","command":"/bin/bash -lc 'node --check voice_cloning/voice_cloning_service.js && node --check user_audio_profile/user_audio_profile_service.js'","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_48","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_48","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_49","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_49","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_50","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/job/job_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_50","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/job/job_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_51","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_51","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_52","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_52","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_53","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/job/job_service.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_53","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"},{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/job/job_service.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_54","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_54","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_55","type":"command_execution","command":"/bin/bash -lc \"ls -la | sed -n '1,80p' && find . -maxdepth 2 -name '.prettierrc*' -print\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_55","type":"command_execution","command":"/bin/bash -lc \"ls -la | sed -n '1,80p' && find . -maxdepth 2 -name '.prettierrc*' -print\"","aggregated_output":"total 176\ndrwxr-xr-x   1 root root  4096 Oct  9 22:46 .\ndrwxr-xr-x   1 root root  4096 Oct 14 18:06 ..\ndrwxr-xr-x   2 root root  4096 Oct  9 22:46 .claude\ndrwxr-xr-x   1 root root  4096 Oct 14 18:06 .git\n-rw-r--r--   1 root root  2308 Oct  9 22:44 .gitignore\ndrwxr-xr-x   2 root root  4096 Oct  9 22:44 .styx_prs\n-rw-r--r--   1 root root   126 Oct  9 22:44 README.md\ndrwxr-xr-x   3 root root  4096 Oct  9 22:44 app\ndrwxr-xr-x 206 root root  4096 Oct  9 22:46 node_modules\n-rw-r--r--   1 root root 92508 Oct  9 22:46 package-lock.json\n-rw-r--r--   1 root root   457 Oct  9 22:44 package.json\n-rw-r--r--   1 root root   180 Oct  9 22:44 requirements.dev.local.txt\n-rw-r--r--   1 root root   439 Oct  9 22:44 requirements.dev.txt\n-rw-r--r--   1 root root   177 Oct  9 22:44 requirements.prod.cpu.txt\n-rw-r--r--   1 root root   155 Oct  9 22:44 requirements.prod.gpu.txt\n-rw-r--r--   1 root root   447 Oct  9 22:44 requirements.txt\ndrwxr-xr-x   5 root root  4096 Oct  9 22:44 voice-cloning\ndrwxr-xr-x   1 root root  4096 Oct  9 22:44 voice-cloning-job-handler\ndrwxr-xr-x   1 root root  4096 Oct  9 22:44 voice-synthsizer-job-handler\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_56","type":"command_execution","command":"/bin/bash -lc 'file voice-synthsizer-job-handler/salutation/salutation_service.js voice-synthsizer-job-handler/index.js voice-cloning-job-handler/index.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_56","type":"command_execution","command":"/bin/bash -lc 'file voice-synthsizer-job-handler/salutation/salutation_service.js voice-synthsizer-job-handler/index.js voice-cloning-job-handler/index.js'","aggregated_output":"voice-synthsizer-job-handler/salutation/salutation_service.js: ASCII text, with CRLF line terminators\nvoice-synthsizer-job-handler/index.js:                         ASCII text\nvoice-cloning-job-handler/index.js:                            ASCII text\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_57","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_58","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_59","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/index.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_60","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-cloning-job-handler/index.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_57","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_58","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_59","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/index.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_60","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-cloning-job-handler/index.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_61","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/job/job_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_62","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_63","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_61","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/job/job_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_62","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_63","type":"command_execution","command":"/bin/bash -lc \"node --check '/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_64","type":"command_execution","command":"/bin/bash -lc 'git diff --stat && git diff --check && git status --short'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_64","type":"command_execution","command":"/bin/bash -lc 'git diff --stat && git diff --check && git status --short'","aggregated_output":" voice-cloning-job-handler/index.js                 | 214 +++++++++++++++------\n .../user_audio_profile_service.js                  | 117 ++++++-----\n .../voice_cloning/voice_cloning_service.js         |  77 +++++---\n voice-synthsizer-job-handler/index.js              | 176 +++++++++++------\n voice-synthsizer-job-handler/job/job_service.js    |  43 ++++-\n .../salutation/salutation_service.js               |  44 ++++-\n .../user_audio_profile_service.js                  |  45 ++++-\n 7 files changed, 488 insertions(+), 228 deletions(-)\nvoice-synthsizer-job-handler/salutation/salutation_service.js:2: trailing whitespace.\n+  if (!userId) throw new Error('userId is required to create a salutation')\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:3: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:9: trailing whitespace.\n+const read = (Salutation) => async (filter, userId = filter.userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:10: trailing whitespace.\n+  if (!userId) throw new Error('userId is required to read a salutation')\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:11: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:14: trailing whitespace.\n+    userId,\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:20: trailing whitespace.\n+const find = (Salutation) => async (filter, userId = filter.userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:21: trailing whitespace.\n+  if (!userId) throw new Error('userId is required to find salutations')\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:22: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:25: trailing whitespace.\n+    userId,\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:32: trailing whitespace.\n+  if (!userId) throw new Error('userId is required to update a salutation')\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:33: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:34: trailing whitespace.\n+  const updates =\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:35: trailing whitespace.\n+    typeof salutation.toObject === 'function'\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:36: trailing whitespace.\n+      ? salutation.toObject()\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:37: trailing whitespace.\n+      : { ...salutation }\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:38: trailing whitespace.\n+  delete updates._id\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:39: trailing whitespace.\n+  delete updates.userId\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:40: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:42: trailing whitespace.\n+    { _id: salutation._id, userId, deleted: false },\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:43: trailing whitespace.\n+    { $set: updates },\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:49: trailing whitespace.\n+const modify =\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:50: trailing whitespace.\n+  (Salutation) => async (salutation, userId = salutation.userId) => {\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:51: trailing whitespace.\n+  if (!userId) throw new Error('userId is required to modify a salutation')\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:52: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:54: trailing whitespace.\n+    ? { _id: salutation._id, userId, deleted: false }\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:55: trailing whitespace.\n+    : { transcriptId: salutation.transcriptId, userId, deleted: false }\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:56: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:57: trailing whitespace.\n+  const updates = { ...salutation }\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:58: trailing whitespace.\n+  delete updates._id\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:59: trailing whitespace.\n+  delete updates.userId\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:63: trailing whitespace.\n+    { $set: updates },\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:89: trailing whitespace.\n+  if (!userId) throw new Error('userId is required to remove a salutation')\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:90: trailing whitespace.\n+\r\nvoice-synthsizer-job-handler/salutation/salutation_service.js:92: trailing whitespace.\n+    { ...filter, userId, deleted: false },\r\n","exit_code":2,"status":"failed"}}
{"type":"item.started","item":{"id":"item_65","type":"command_execution","command":"/bin/bash -lc 'git diff -- voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_65","type":"command_execution","command":"/bin/bash -lc 'git diff -- voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'","aggregated_output":"diff --git a/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js b/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\nindex e76643d..cac9e78 100644\n--- a/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n+++ b/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n@@ -2,6 +2,9 @@ const StringifyUtils = require('../../app/services/utils/logService')\n \n const create = (UserAudioProfileModel) => async (data) => {\n   try {\n+    if (!data.userId)\n+      throw new Error('userId is required to create an audio profile')\n+\n     const newModel = new UserAudioProfileModel({ ...data })\n     const savedModel = await newModel.save()\n     return savedModel\n@@ -17,6 +20,9 @@ const create = (UserAudioProfileModel) => async (data) => {\n \n const insertMany = (UserAudioProfileModel) => async (data) => {\n   try {\n+    if (!data.every((item) => item.userId))\n+      throw new Error('userId is required to create audio profiles')\n+\n     const inserted = await UserAudioProfileModel.insertMany(data)\n     return inserted\n   } catch (error) {\n@@ -29,45 +35,58 @@ const insertMany = (UserAudioProfileModel) => async (data) => {\n   }\n }\n \n-const read = (UserAudioProfileModel) => async (filter) => {\n-  try {\n+const read =\n+  (UserAudioProfileModel) => async (filter, userId = filter.userId) => {\n+    try {\n+    if (!userId) throw new Error('userId is required to read an audio profile')\n+\n     const foundModel = await UserAudioProfileModel.findOne({\n       ...filter,\n+      userId,\n       deleted: false,\n     })\n     return foundModel\n-  } catch (error) {\n-    const details = { filter }\n-    console.log(\n-      'ERROR - USER AUDIO PROFILE SERVICE > read',\n-      StringifyUtils.potionErrorObj(error, details)\n-    )\n-    throw error\n+    } catch (error) {\n+      const details = { filter }\n+      console.log(\n+        'ERROR - USER AUDIO PROFILE SERVICE > read',\n+        StringifyUtils.potionErrorObj(error, details)\n+      )\n+      throw error\n+    }\n   }\n-}\n \n-const find = (UserAudioProfileModel) => async (filter) => {\n-  try {\n+const find =\n+  (UserAudioProfileModel) => async (filter, userId = filter.userId) => {\n+    try {\n+    if (!userId) throw new Error('userId is required to find audio profiles')\n+\n     const foundModels = await UserAudioProfileModel.find({\n       ...filter,\n+      userId,\n       deleted: false,\n     })\n     return foundModels\n-  } catch (error) {\n-    const details = { filter }\n-    console.log(\n-      'ERROR - USER AUDIO PROFILE SERVICE > find',\n-      StringifyUtils.potionErrorObj(error, details)\n-    )\n-    throw error\n+    } catch (error) {\n+      const details = { filter }\n+      console.log(\n+        'ERROR - USER AUDIO PROFILE SERVICE > find',\n+        StringifyUtils.potionErrorObj(error, details)\n+      )\n+      throw error\n+    }\n   }\n-}\n \n-const update = (UserAudioProfileModel) => async (data) => {\n+const update = (UserAudioProfileModel) => async (data, userId = data.userId) => {\n   try {\n+    if (!userId)\n+      throw new Error('userId is required to update an audio profile')\n+\n+    const { _id, ...updates } = data\n+    delete updates.userId\n     const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n-      { _id: data._id },\n-      data,\n+      { _id, userId, deleted: false },\n+      { $set: updates },\n       {\n         new: true,\n       }\n@@ -83,10 +102,14 @@ const update = (UserAudioProfileModel) => async (data) => {\n   }\n }\n \n-const remove = (UserAudioProfileModel) => async (filter) => {\n-  try {\n+const remove =\n+  (UserAudioProfileModel) => async (filter, userId = filter.userId) => {\n+    try {\n+    if (!userId)\n+      throw new Error('userId is required to remove an audio profile')\n+\n     const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n-      { ...filter },\n+      { ...filter, userId },\n       {\n         $set: {\n           deleted: true,\n@@ -95,20 +118,24 @@ const remove = (UserAudioProfileModel) => async (filter) => {\n       { new: true }\n     )\n     return updatedModel\n-  } catch (error) {\n-    const details = { filter }\n-    console.log(\n-      'ERROR - USER AUDIO PROFILE SERVICE > remove',\n-      StringifyUtils.potionErrorObj(error, details)\n-    )\n-    throw error\n+    } catch (error) {\n+      const details = { filter }\n+      console.log(\n+        'ERROR - USER AUDIO PROFILE SERVICE > remove',\n+        StringifyUtils.potionErrorObj(error, details)\n+      )\n+      throw error\n+    }\n   }\n-}\n \n-const removeMany = (UserAudioProfileModel) => async (filter) => {\n-  try {\n+const removeMany =\n+  (UserAudioProfileModel) => async (filter, userId = filter.userId) => {\n+    try {\n+    if (!userId)\n+      throw new Error('userId is required to remove audio profiles')\n+\n     const updatedModel = await UserAudioProfileModel.updateMany(\n-      { ...filter },\n+      { ...filter, userId },\n       {\n         $set: {\n           deleted: true,\n@@ -117,15 +144,15 @@ const removeMany = (UserAudioProfileModel) => async (filter) => {\n       { new: true }\n     )\n     return updatedModel\n-  } catch (error) {\n-    const details = { filter }\n-    console.log(\n-      'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n-      StringifyUtils.potionErrorObj(error, details)\n-    )\n-    throw error\n+    } catch (error) {\n+      const details = { filter }\n+      console.log(\n+        'ERROR - USER AUDIO PROFILE SERVICE > removeMany',\n+        StringifyUtils.potionErrorObj(error, details)\n+      )\n+      throw error\n+    }\n   }\n-}\n \n module.exports = (UserAudioProfileModel) => {\n   return {\ndiff --git a/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js b/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\nindex 329638e..67f9ab6 100644\n--- a/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n+++ b/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n@@ -2,6 +2,9 @@ const StringifyUtils = require('../../app/services/utils/logService')\n \n const create = (VoiceCloningModel) => async (data) => {\n   try {\n+    if (!data.userId)\n+      throw new Error('userId is required to create a voice clone')\n+\n     const newModel = new VoiceCloningModel({ ...data })\n     const savedModel = await newModel.save()\n     return savedModel\n@@ -17,6 +20,9 @@ const create = (VoiceCloningModel) => async (data) => {\n \n const insertMany = (VoiceCloningModel) => async (data) => {\n   try {\n+    if (!data.every((item) => item.userId))\n+      throw new Error('userId is required to create voice clones')\n+\n     const inserted = await VoiceCloningModel.insertMany(data)\n     return inserted\n   } catch (error) {\n@@ -29,10 +35,13 @@ const insertMany = (VoiceCloningModel) => async (data) => {\n   }\n }\n \n-const read = (VoiceCloningModel) => async (filter) => {\n+const read = (VoiceCloningModel) => async (filter, userId = filter.userId) => {\n   try {\n+    if (!userId) throw new Error('userId is required to read a voice clone')\n+\n     const foundModel = await VoiceCloningModel.findOne({\n       ...filter,\n+      userId,\n       deleted: false,\n     })\n     return foundModel\n@@ -46,10 +55,13 @@ const read = (VoiceCloningModel) => async (filter) => {\n   }\n }\n \n-const find = (VoiceCloningModel) => async (filter) => {\n+const find = (VoiceCloningModel) => async (filter, userId = filter.userId) => {\n   try {\n+    if (!userId) throw new Error('userId is required to find voice clones')\n+\n     const foundModels = await VoiceCloningModel.find({\n       ...filter,\n+      userId,\n       deleted: false,\n     })\n     return foundModels\n@@ -63,11 +75,15 @@ const find = (VoiceCloningModel) => async (filter) => {\n   }\n }\n \n-const update = (VoiceCloningModel) => async (data) => {\n+const update = (VoiceCloningModel) => async (data, userId = data.userId) => {\n   try {\n+    if (!userId) throw new Error('userId is required to update a voice clone')\n+\n+    const { _id, ...updates } = data\n+    delete updates.userId\n     const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n-      { _id: data._id },\n-      data,\n+      { _id, userId, deleted: false },\n+      { $set: updates },\n       {\n         new: true,\n       }\n@@ -84,10 +100,13 @@ const update = (VoiceCloningModel) => async (data) => {\n   }\n }\n \n-const remove = (VoiceCloningModel) => async (filter) => {\n-  try {\n+const remove =\n+  (VoiceCloningModel) => async (filter, userId = filter.userId) => {\n+    try {\n+    if (!userId) throw new Error('userId is required to remove a voice clone')\n+\n     const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n-      { ...filter },\n+      { ...filter, userId },\n       {\n         $set: {\n           deleted: true,\n@@ -96,20 +115,24 @@ const remove = (VoiceCloningModel) => async (filter) => {\n       { new: true }\n     )\n     return updatedModel\n-  } catch (error) {\n-    const details = { filter }\n-    console.log(\n-      'ERROR - VOICE CLONING SERVICE > remove',\n-      StringifyUtils.potionErrorObj(error, details)\n-    )\n-    throw error\n+    } catch (error) {\n+      const details = { filter }\n+      console.log(\n+        'ERROR - VOICE CLONING SERVICE > remove',\n+        StringifyUtils.potionErrorObj(error, details)\n+      )\n+      throw error\n+    }\n   }\n-}\n \n-const removeMany = (VoiceCloningModel) => async (filter) => {\n-  try {\n+const removeMany =\n+  (VoiceCloningModel) => async (filter, userId = filter.userId) => {\n+    try {\n+    if (!userId)\n+      throw new Error('userId is required to remove voice clones')\n+\n     const updatedModel = await VoiceCloningModel.updateMany(\n-      { ...filter },\n+      { ...filter, userId },\n       {\n         $set: {\n           deleted: true,\n@@ -118,15 +141,15 @@ const removeMany = (VoiceCloningModel) => async (filter) => {\n       { new: true }\n     )\n     return updatedModel\n-  } catch (error) {\n-    const details = { filter }\n-    console.log(\n-      'ERROR - VOICE CLONING SERVICE > removeMany',\n-      StringifyUtils.potionErrorObj(error, details)\n-    )\n-    throw error\n+    } catch (error) {\n+      const details = { filter }\n+      console.log(\n+        'ERROR - VOICE CLONING SERVICE > removeMany',\n+        StringifyUtils.potionErrorObj(error, details)\n+      )\n+      throw error\n+    }\n   }\n-}\n \n module.exports = (VoiceCloningModel) => {\n   return {\n","exit_code":0,"status":"completed"}}
2026-10-14T18:13:02.428488Z ERROR codex_core::tools::router: error=apply_patch verification failed: invalid patch: multiple operations target /workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js
{"type":"item.started","item":{"id":"item_66","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"delete"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_66","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"delete"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_67","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"add"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_67","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js","kind":"add"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_68","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"delete"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_68","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"delete"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_69","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"add"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_69","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"add"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_70","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"delete"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_70","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"delete"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_71","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"add"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_71","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js","kind":"add"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_72","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,230p' job/job_service.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_72","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,230p' job/job_service.js\"","aggregated_output":"const StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (Job) => async (jobData) => {\n  try {\n    if (!jobData.userId) throw new Error('userId is required to create a job')\n\n    const newJob = new Job({ ...jobData })\n    const savedJob = await newJob.save()\n    return savedJob\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (Job) => async (jobData) => {\n  try {\n    if (!jobData.every((job) => job.userId))\n      throw new Error('userId is required to create jobs')\n\n    const inserted = await Job.insertMany(jobData)\n    return inserted\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read = (Job) => async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to read a job')\n\n    const foundJob = await Job.findOne({\n      ...filter,\n      userId,\n      deleted: false,\n    })\n    return foundJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > read',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst find = (Job) => async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to find jobs')\n\n    const foundJobs = await Job.find({\n      ...filter,\n      userId,\n      deleted: false,\n    })\n    return foundJobs\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > find',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst update = (Job) => async (job, userId = job.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to update a job')\n\n    const { _id, ...updates } = job\n    delete updates.userId\n    const updatedJob = await Job.findOneAndUpdate(\n      { _id, userId, deleted: false },\n      { $set: updates },\n      {\n        new: true,\n      }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { job }\n    console.log(\n      'ERROR - JOB SERVICE > update',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst remove = (Job) => async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to remove a job')\n\n    const updatedJob = await Job.findOneAndUpdate(\n      { ...filter, userId },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > remove',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst removeMany = (Job) => async (filter, userId = filter.userId) => {\n  try {\n    if (!userId) throw new Error('userId is required to remove jobs')\n\n    const updatedJob = await Job.updateMany(\n      { ...filter, userId },\n      {\n        $set: {\n          deleted: true,\n        },\n      },\n      { new: true }\n    )\n    return updatedJob\n  } catch (error) {\n    const details = { filter }\n    console.log(\n      'ERROR - JOB SERVICE > removeMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nmodule.exports = (Job) => {\n  return {\n    create: create(Job),\n    insertMany: insertMany(Job),\n    read: read(Job),\n    remove: remove(Job),\n    removeMany: removeMany(Job),\n    update: update(Job),\n    find: find(Job),\n  }\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_73","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"delete"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_73","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"delete"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_74","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"add"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_74","type":"file_change","changes":[{"path":"/workspace/voice-synthsizer-job-handler/salutation/salutation_service.js","kind":"add"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_75","type":"command_execution","command":"/bin/bash -lc 'npx prettier@2.8.8 --no-semi --single-quote --trailing-comma es5 --end-of-line lf --write voice-cloning-job-handler/index.js voice-cloning-job-handler/voice_cloning/voice_cloning_service.js voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js voice-synthsizer-job-handler/index.js voice-synthsizer-job-handler/job/job_service.js voice-synthsizer-job-handler/salutation/salutation_service.js voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_75","type":"command_execution","command":"/bin/bash -lc 'npx prettier@2.8.8 --no-semi --single-quote --trailing-comma es5 --end-of-line lf --write voice-cloning-job-handler/index.js voice-cloning-job-handler/voice_cloning/voice_cloning_service.js voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js voice-synthsizer-job-handler/index.js voice-synthsizer-job-handler/job/job_service.js voice-synthsizer-job-handler/salutation/salutation_service.js voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'","aggregated_output":"npx: installed 1 in 1.143s\nvoice-cloning-job-handler/index.js 122ms\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js 23ms\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js 16ms\nvoice-synthsizer-job-handler/index.js 40ms\nvoice-synthsizer-job-handler/job/job_service.js 14ms\nvoice-synthsizer-job-handler/salutation/salutation_service.js 14ms\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js 11ms\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_76","type":"command_execution","command":"/bin/bash -lc 'git status --short && git diff --stat && git diff --check'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_76","type":"command_execution","command":"/bin/bash -lc 'git status --short && git diff --stat && git diff --check'","aggregated_output":" M voice-cloning-job-handler/index.js\n M voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n M voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n M voice-synthsizer-job-handler/index.js\n M voice-synthsizer-job-handler/job/job_service.js\n M voice-synthsizer-job-handler/salutation/salutation_service.js\n M voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n voice-cloning-job-handler/index.js                 | 507 ++++++++++++---------\n .../user_audio_profile_service.js                  | 230 ++++++----\n .../voice_cloning/voice_cloning_service.js         | 229 ++++++----\n voice-synthsizer-job-handler/index.js              | 387 +++++++++-------\n voice-synthsizer-job-handler/job/job_service.js    | 197 ++++----\n .../salutation/salutation_service.js               | 211 +++++----\n .../user_audio_profile_service.js                  | 232 ++++++----\n 7 files changed, 1139 insertions(+), 854 deletions(-)\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_77","type":"command_execution","command":"/bin/bash -lc \"git diff --numstat && git diff -- voice-cloning-job-handler/index.js | sed -n '1,220p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_77","type":"command_execution","command":"/bin/bash -lc \"git diff --numstat && git diff -- voice-cloning-job-handler/index.js | sed -n '1,220p'\"","aggregated_output":"292\t215\tvoice-cloning-job-handler/index.js\n131\t99\tvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n130\t99\tvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n216\t171\tvoice-synthsizer-job-handler/index.js\n115\t82\tvoice-synthsizer-job-handler/job/job_service.js\n124\t87\tvoice-synthsizer-job-handler/salutation/salutation_service.js\n131\t101\tvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\ndiff --git a/voice-cloning-job-handler/index.js b/voice-cloning-job-handler/index.js\nindex 0995e23..578f012 100644\n--- a/voice-cloning-job-handler/index.js\n+++ b/voice-cloning-job-handler/index.js\n@@ -28,24 +28,45 @@ const updateUrl = (str, cloudFrontUrl) => {\n   return str.replace(`https://${host}`, cloudFrontUrl)\n }\n \n-function connectDB(dbUri, retryCount = 0) {\n-  return new Promise((resolve, reject) => {\n-    console.log('Connection Attempt : ', retryCount)\n-    mongoose.set('strictQuery', true)\n-    mongoose\n-      .connect(dbUri)\n-      .then((msg) => {\n-        console.log('Connected to Mongo DB !')\n-        resolve()\n-      })\n-      .catch((err) => {\n-        console.log('Failed to connect dns mongo: ', err)\n-        if (retryCount < 6) {\n-          retryCount++\n-          connectDB(dbUri, retryCount)\n-        }\n-      })\n-  })\n+async function connectDB(dbUri, retryCount = 0) {\n+  console.log('Connection Attempt : ', retryCount)\n+  mongoose.set('strictQuery', true)\n+\n+  try {\n+    await mongoose.connect(dbUri)\n+    console.log('Connected to Mongo DB !')\n+  } catch (error) {\n+    console.log('Failed to connect dns mongo: ', error)\n+    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n+    throw error\n+  }\n+}\n+\n+class RejectedJobError extends Error {\n+  constructor(message) {\n+    super(message)\n+    this.name = 'RejectedJobError'\n+  }\n+}\n+\n+const validateObjectId = (value, fieldName) => {\n+  if (!mongoose.isObjectIdOrHexString(value)) {\n+    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n+  }\n+}\n+\n+const getJobContext = (job) => {\n+  if (!job || !job._doc || typeof job._doc !== 'object') {\n+    throw new RejectedJobError('Invalid voice cloning job payload')\n+  }\n+\n+  const { metadata, input, _id, userAudioProfileId, userId } = job._doc\n+\n+  validateObjectId(_id, '_id')\n+  validateObjectId(userAudioProfileId, 'userAudioProfileId')\n+  validateObjectId(userId, 'userId')\n+\n+  return { metadata, input, _id, userAudioProfileId, userId, env: job.env }\n }\n \n function execShellCommand(cmd, logPath) {\n@@ -86,225 +107,281 @@ function pad(s) {\n   return s\n }\n \n-const processQueue = () => {\n-  /* eslint-disable no-async-promise-executor */\n-  return new Promise(async (resolve, reject) => {\n-    try {\n-      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n-\n-      if (\n-        typeof response.Messages !== 'undefined' &&\n-        response.Messages.length > 0\n-      ) {\n-        throttleMessageFetching = false\n-        const job = JSON.parse(response.Messages[0].Body)\n-        const receiptHandle = response.Messages[0].ReceiptHandle\n-        console.log('job===', job)\n-\n-        const { metadata, input, _id, userAudioProfileId } = job._doc\n-        console.log('userAudioProfileId', userAudioProfileId)\n-        console.log('_id', _id)\n-        const { env } = job\n-        console.log('env', env)\n-\n-        console.log('metadata------', metadata)\n-        console.log('input', input)\n-        const DB_URI =\n-          env === 'production'\n-            ? mongoUriProd\n-            : env === 'staging'\n-            ? mongoUriStaging\n-            : mongoUriDev\n-\n-        console.log('DB_URI ', DB_URI)\n-        await connectDB(DB_URI)\n-\n-        const cloudFrontUrl =\n-          env === 'production'\n-            ? cloudFrontUrlProd\n-            : env === 'staging'\n-            ? cloudFrontUrlStaging\n-            : cloudFrontUrlDev\n-\n-        try {\n-          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n-\n-          const { directoryName } = metadata\n-          console.log('directoryName', directoryName)\n-          const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n-          if (!fs.existsSync(logPath)) {\n-            fs.mkdirSync(logPath, { recursive: true })\n-          }\n-          // update the db model to processing\n-          await voiceCloningService.update({ _id, status: 'processing' })\n-          await userAudioProfileService.update({\n-            _id: userAudioProfileId,\n-            status: 'processing',\n-          })\n-\n-          // create directory for userid-useraudioprofileid if not exist\n-          const rootPath = `/tmp/${directoryName}`\n-          const wavePath = `${rootPath}/wav48/1`\n-          if (!fs.existsSync(wavePath)) {\n-            fs.mkdirSync(wavePath, { recursive: true })\n-          }\n-\n-          const txtPath = `${rootPath}/txt/1`\n-          if (!fs.existsSync(txtPath)) {\n-            fs.mkdirSync(txtPath, { recursive: true })\n-          }\n-          // download the training data files and put it in respective directories\n-          for (let index = 0; index < input.length; index++) {\n-            const item = input[index]\n+const processQueue = async () => {\n+  let message\n+  let messageDeleted = false\n \n-            const { waveUrl, originalText } = item\n-            // download wave file\n-            const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n-\n-            await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n-\n-            const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n-            await fs.promises.writeFile(txtFilePath, originalText)\n-          }\n-\n-          const zipFileName = directoryName + '.tgz'\n-\n-          // /tmp/directoryName.tgz\n-\n-          await execShellCommand(\n-            `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n-            logPath\n-          )\n-          console.log('ZIP created ', zipFileName)\n-\n-          // re-sample audio\n-          const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n-          console.time(SAMPLING_LABEL)\n-\n-          const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n-\n-          const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n-          console.log('samplingCommand ', samplingCommand)\n-          const samplingResponse = await execShellCommand(\n-            samplingCommand,\n-            logPath\n-          )\n-          console.timeEnd(SAMPLING_LABEL)\n-\n-          // /mnt/efs/potion-voice/${env}/speakrs.pth\n-          // /mnt/efs/potion-voice/${env}/txt\n-          // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n-\n-          const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n-\n-          const resultsPath = outPath + '/results'\n-\n-          //update pth file for cloning\n-          // clone the voice\n-          const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n-          console.time(VOICE_CLONING_LABEL)\n-          const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n-            outPath + '/speakers.pth'\n-          } --output_path ${resultsPath}`\n+  try {\n+    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n+\n+    if (\n+      typeof response.Messages !== 'undefined' &&\n+      response.Messages.length > 0\n+    ) {\n+      throttleMessageFetching = false\n+      message = response.Messages[0]\n+\n+      let job\n+      try {\n+        job = JSON.parse(message.Body)\n+      } catch (error) {\n+        throw new RejectedJobError('Invalid JSON in voice cloning job')\n+      }\n \n-          console.log('Training Model Command', trainingModelCommand)\n-          const trainingResponse = await execShellCommand(\n-            trainingModelCommand,\n-            logPath\n-          )\n+      console.log('job===', job)\n+\n+      const { metadata, input, _id, userAudioProfileId, userId, env } =\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_78","type":"agent_message","text":"Both handlers now reject missing/malformed tenant identifiers, verify ownership before work begins, and acknowledge poison/unauthorized messages without escaping the per-message error boundary. I’m running a query-by-query audit and mock-based service checks next."}}
{"type":"item.started","item":{"id":"item_79","type":"command_execution","command":"/bin/bash -lc \"rg -n -C 3 \\\"\\\\.findOne\\\\(|\\\\.find\\\\(|findOneAndUpdate\\\\(|updateMany\\\\(|insertMany\\\\(|\\\\.save\\\\(\\\" -g '*.js' .\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_79","type":"command_execution","command":"/bin/bash -lc \"rg -n -C 3 \\\"\\\\.findOne\\\\(|\\\\.find\\\\(|findOneAndUpdate\\\\(|updateMany\\\\(|insertMany\\\\(|\\\\.save\\\\(\\\" -g '*.js' .\"","aggregated_output":"./salutation/salutation_service.js-17-    ...salutationData,\n./salutation/salutation_service.js-18-    userId: tenantId,\n./salutation/salutation_service.js-19-  })\n./salutation/salutation_service.js:20:  const savedSalutation = await newSalutation.save()\n./salutation/salutation_service.js-21-  return savedSalutation\n./salutation/salutation_service.js-22-}\n./salutation/salutation_service.js-23-\n--\n./salutation/salutation_service.js-25-  (Salutation) =>\n./salutation/salutation_service.js-26-  async (filter = {}, userId) => {\n./salutation/salutation_service.js-27-    const tenantId = requireUserId(userId || filter.userId, 'read a salutation')\n./salutation/salutation_service.js:28:    const foundSalutation = await Salutation.findOne({\n./salutation/salutation_service.js-29-      ...filter,\n./salutation/salutation_service.js-30-      userId: tenantId,\n./salutation/salutation_service.js-31-      deleted: false,\n--\n./salutation/salutation_service.js-37-  (Salutation) =>\n./salutation/salutation_service.js-38-  async (filter = {}, userId) => {\n./salutation/salutation_service.js-39-    const tenantId = requireUserId(userId || filter.userId, 'find salutations')\n./salutation/salutation_service.js:40:    const foundSalutations = await Salutation.find({\n./salutation/salutation_service.js-41-      ...filter,\n./salutation/salutation_service.js-42-      userId: tenantId,\n./salutation/salutation_service.js-43-      deleted: false,\n--\n./salutation/salutation_service.js-47-\n./salutation/salutation_service.js-48-const update = (Salutation) => async (salutation, userId) => {\n./salutation/salutation_service.js-49-  const tenantId = requireUserId(userId, 'update a salutation')\n./salutation/salutation_service.js:50:  const updatedSalutation = await Salutation.findOneAndUpdate(\n./salutation/salutation_service.js-51-    { _id: salutation._id, userId: tenantId, deleted: false },\n./salutation/salutation_service.js-52-    { $set: getUpdates(salutation) },\n./salutation/salutation_service.js-53-    { new: true }\n--\n./salutation/salutation_service.js-70-          deleted: false,\n./salutation/salutation_service.js-71-        }\n./salutation/salutation_service.js-72-\n./salutation/salutation_service.js:73:    const updatedSalutation = await Salutation.findOneAndUpdate(\n./salutation/salutation_service.js-74-      findQuery,\n./salutation/salutation_service.js-75-      { $set: getUpdates(salutation) },\n./salutation/salutation_service.js-76-      { new: true }\n--\n./salutation/salutation_service.js-105-      userId || filter.userId,\n./salutation/salutation_service.js-106-      'remove a salutation'\n./salutation/salutation_service.js-107-    )\n./salutation/salutation_service.js:108:    const updatedSalutation = await Salutation.findOneAndUpdate(\n./salutation/salutation_service.js-109-      { ...filter, userId: tenantId, deleted: false },\n./salutation/salutation_service.js-110-      { $set: { deleted: true } },\n./salutation/salutation_service.js-111-      { new: true }\n--\n./index.js-126-          const { training_model_path } = userAudioProfile\n./index.js-127-\n./index.js-128-          const [salutationToUpdate, recordingToUpdate] = await Promise.all([\n./index.js:129:            recordingSalutationModel.findOne({\n./index.js-130-              _id: salutationId,\n./index.js-131-              userId,\n./index.js-132-              deleted: false,\n./index.js-133-            }),\n./index.js:134:            recordingModel.findOne({\n./index.js-135-              _id: recordingId,\n./index.js-136-              userId,\n./index.js-137-              deleted: false,\n--\n./index.js-194-          const jobsToInsert = []\n./index.js-195-\n./index.js-196-          const updatedRecordingSalutation =\n./index.js:197:            await recordingSalutationModel.findOneAndUpdate(\n./index.js-198-              {\n./index.js-199-                _id: salutationId,\n./index.js-200-                userId,\n--\n./index.js-244-\n./index.js-245-          // create the job for the ai to create processing\n./index.js-246-          if (jobsToInsert.length) {\n./index.js:247:            await jobService.insertMany(jobsToInsert)\n./index.js-248-          }\n./index.js-249-\n./index.js-250-          fs.unlinkSync(`${outputPath}${generatedFileName}`)\n--\n./job/job_service.js-5-    if (!jobData.userId) throw new Error('userId is required to create a job')\n./job/job_service.js-6-\n./job/job_service.js-7-    const newJob = new Job({ ...jobData })\n./job/job_service.js:8:    const savedJob = await newJob.save()\n./job/job_service.js-9-    return savedJob\n./job/job_service.js-10-  } catch (error) {\n./job/job_service.js-11-    const details = { jobData }\n--\n./job/job_service.js-22-    if (!jobData.every((job) => job.userId))\n./job/job_service.js-23-      throw new Error('userId is required to create jobs')\n./job/job_service.js-24-\n./job/job_service.js:25:    const inserted = await Job.insertMany(jobData)\n./job/job_service.js-26-    return inserted\n./job/job_service.js-27-  } catch (error) {\n./job/job_service.js-28-    const details = { jobData }\n--\n./job/job_service.js-40-    try {\n./job/job_service.js-41-      if (!userId) throw new Error('userId is required to read a job')\n./job/job_service.js-42-\n./job/job_service.js:43:      const foundJob = await Job.findOne({\n./job/job_service.js-44-        ...filter,\n./job/job_service.js-45-        userId,\n./job/job_service.js-46-        deleted: false,\n--\n./job/job_service.js-62-    try {\n./job/job_service.js-63-      if (!userId) throw new Error('userId is required to find jobs')\n./job/job_service.js-64-\n./job/job_service.js:65:      const foundJobs = await Job.find({\n./job/job_service.js-66-        ...filter,\n./job/job_service.js-67-        userId,\n./job/job_service.js-68-        deleted: false,\n--\n./job/job_service.js-86-\n./job/job_service.js-87-      const { _id, ...updates } = job\n./job/job_service.js-88-      delete updates.userId\n./job/job_service.js:89:      const updatedJob = await Job.findOneAndUpdate(\n./job/job_service.js-90-        { _id, userId, deleted: false },\n./job/job_service.js-91-        { $set: updates },\n./job/job_service.js-92-        {\n--\n./job/job_service.js-110-    try {\n./job/job_service.js-111-      if (!userId) throw new Error('userId is required to remove a job')\n./job/job_service.js-112-\n./job/job_service.js:113:      const updatedJob = await Job.findOneAndUpdate(\n./job/job_service.js-114-        { ...filter, userId },\n./job/job_service.js-115-        {\n./job/job_service.js-116-          $set: {\n--\n./job/job_service.js-136-    try {\n./job/job_service.js-137-      if (!userId) throw new Error('userId is required to remove jobs')\n./job/job_service.js-138-\n./job/job_service.js:139:      const updatedJob = await Job.updateMany(\n./job/job_service.js-140-        { ...filter, userId },\n./job/job_service.js-141-        {\n./job/job_service.js-142-          $set: {\n--\n./job/job_service.js-159-module.exports = (Job) => {\n./job/job_service.js-160-  return {\n./job/job_service.js-161-    create: create(Job),\n./job/job_service.js:162:    insertMany: insertMany(Job),\n./job/job_service.js-163-    read: read(Job),\n./job/job_service.js-164-    remove: remove(Job),\n./job/job_service.js-165-    removeMany: removeMany(Job),\n--\n./user_audio_profile/user_audio_profile_service.js-9-  try {\n./user_audio_profile/user_audio_profile_service.js-10-    requireUserId(data.userId, 'create an audio profile')\n./user_audio_profile/user_audio_profile_service.js-11-    const newModel = new UserAudioProfileModel({ ...data })\n./user_audio_profile/user_audio_profile_service.js:12:    const savedModel = await newModel.save()\n./user_audio_profile/user_audio_profile_service.js-13-    return savedModel\n./user_audio_profile/user_audio_profile_service.js-14-  } catch (error) {\n./user_audio_profile/user_audio_profile_service.js-15-    const details = { data }\n--\n./user_audio_profile/user_audio_profile_service.js-27-      throw new Error('userId is required to create audio profiles')\n./user_audio_profile/user_audio_profile_service.js-28-    }\n./user_audio_profile/user_audio_profile_service.js-29-\n./user_audio_profile/user_audio_profile_service.js:30:    const inserted = await UserAudioProfileModel.insertMany(data)\n./user_audio_profile/user_audio_profile_service.js-31-    return inserted\n./user_audio_profile/user_audio_profile_service.js-32-  } catch (error) {\n./user_audio_profile/user_audio_profile_service.js-33-    const details = { data }\n--\n./user_audio_profile/user_audio_profile_service.js-47-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-48-        'read an audio profile'\n./user_audio_profile/user_audio_profile_service.js-49-      )\n./user_audio_profile/user_audio_profile_service.js:50:      const foundModel = await UserAudioProfileModel.findOne({\n./user_audio_profile/user_audio_profile_service.js-51-        ...filter,\n./user_audio_profile/user_audio_profile_service.js-52-        userId: tenantId,\n./user_audio_profile/user_audio_profile_service.js-53-        deleted: false,\n--\n./user_audio_profile/user_audio_profile_service.js-71-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-72-        'find audio profiles'\n./user_audio_profile/user_audio_profile_service.js-73-      )\n./user_audio_profile/user_audio_profile_service.js:74:      const foundModels = await UserAudioProfileModel.find({\n./user_audio_profile/user_audio_profile_service.js-75-        ...filter,\n./user_audio_profile/user_audio_profile_service.js-76-        userId: tenantId,\n./user_audio_profile/user_audio_profile_service.js-77-        deleted: false,\n--\n./user_audio_profile/user_audio_profile_service.js-98-      const { _id, ...updates } = data\n./user_audio_profile/user_audio_profile_service.js-99-      delete updates.userId\n./user_audio_profile/user_audio_profile_service.js-100-\n./user_audio_profile/user_audio_profile_service.js:101:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js-102-        { _id, userId: tenantId, deleted: false },\n./user_audio_profile/user_audio_profile_service.js-103-        { $set: updates },\n./user_audio_profile/user_audio_profile_service.js-104-        { new: true }\n--\n./user_audio_profile/user_audio_profile_service.js-122-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-123-        'remove an audio profile'\n./user_audio_profile/user_audio_profile_service.js-124-      )\n./user_audio_profile/user_audio_profile_service.js:125:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js-126-        { ...filter, userId: tenantId },\n./user_audio_profile/user_audio_profile_service.js-127-        { $set: { deleted: true } },\n./user_audio_profile/user_audio_profile_service.js-128-        { new: true }\n--\n./user_audio_profile/user_audio_profile_service.js-146-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-147-        'remove audio profiles'\n./user_audio_profile/user_audio_profile_service.js-148-      )\n./user_audio_profile/user_audio_profile_service.js:149:      const updatedModel = await UserAudioProfileModel.updateMany(\n./user_audio_profile/user_audio_profile_service.js-150-        { ...filter, userId: tenantId },\n./user_audio_profile/user_audio_profile_service.js-151-        { $set: { deleted: true } }\n./user_audio_profile/user_audio_profile_service.js-152-      )\n--\n./user_audio_profile/user_audio_profile_service.js-163-\n./user_audio_profile/user_audio_profile_service.js-164-module.exports = (UserAudioProfileModel) => ({\n./user_audio_profile/user_audio_profile_service.js-165-  create: create(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js:166:  insertMany: insertMany(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js-167-  read: read(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js-168-  remove: remove(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js-169-  removeMany: removeMany(UserAudioProfileModel),\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_80","type":"command_execution","command":"/bin/bash -lc \"rg -n -C 3 \\\"\\\\.findOne\\\\(|\\\\.find\\\\(|findOneAndUpdate\\\\(|updateMany\\\\(|insertMany\\\\(|\\\\.save\\\\(\\\" -g '*.js' .\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_80","type":"command_execution","command":"/bin/bash -lc \"rg -n -C 3 \\\"\\\\.findOne\\\\(|\\\\.find\\\\(|findOneAndUpdate\\\\(|updateMany\\\\(|insertMany\\\\(|\\\\.save\\\\(\\\" -g '*.js' .\"","aggregated_output":"./voice_cloning/voice_cloning_service.js-9-  try {\n./voice_cloning/voice_cloning_service.js-10-    requireUserId(data.userId, 'create a voice clone')\n./voice_cloning/voice_cloning_service.js-11-    const newModel = new VoiceCloningModel({ ...data })\n./voice_cloning/voice_cloning_service.js:12:    const savedModel = await newModel.save()\n./voice_cloning/voice_cloning_service.js-13-    return savedModel\n./voice_cloning/voice_cloning_service.js-14-  } catch (error) {\n./voice_cloning/voice_cloning_service.js-15-    const details = { data }\n--\n./voice_cloning/voice_cloning_service.js-27-      throw new Error('userId is required to create voice clones')\n./voice_cloning/voice_cloning_service.js-28-    }\n./voice_cloning/voice_cloning_service.js-29-\n./voice_cloning/voice_cloning_service.js:30:    const inserted = await VoiceCloningModel.insertMany(data)\n./voice_cloning/voice_cloning_service.js-31-    return inserted\n./voice_cloning/voice_cloning_service.js-32-  } catch (error) {\n./voice_cloning/voice_cloning_service.js-33-    const details = { data }\n--\n./voice_cloning/voice_cloning_service.js-47-        userId || filter.userId,\n./voice_cloning/voice_cloning_service.js-48-        'read a voice clone'\n./voice_cloning/voice_cloning_service.js-49-      )\n./voice_cloning/voice_cloning_service.js:50:      const foundModel = await VoiceCloningModel.findOne({\n./voice_cloning/voice_cloning_service.js-51-        ...filter,\n./voice_cloning/voice_cloning_service.js-52-        userId: tenantId,\n./voice_cloning/voice_cloning_service.js-53-        deleted: false,\n--\n./voice_cloning/voice_cloning_service.js-71-        userId || filter.userId,\n./voice_cloning/voice_cloning_service.js-72-        'find voice clones'\n./voice_cloning/voice_cloning_service.js-73-      )\n./voice_cloning/voice_cloning_service.js:74:      const foundModels = await VoiceCloningModel.find({\n./voice_cloning/voice_cloning_service.js-75-        ...filter,\n./voice_cloning/voice_cloning_service.js-76-        userId: tenantId,\n./voice_cloning/voice_cloning_service.js-77-        deleted: false,\n--\n./voice_cloning/voice_cloning_service.js-98-      const { _id, ...updates } = data\n./voice_cloning/voice_cloning_service.js-99-      delete updates.userId\n./voice_cloning/voice_cloning_service.js-100-\n./voice_cloning/voice_cloning_service.js:101:      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./voice_cloning/voice_cloning_service.js-102-        { _id, userId: tenantId, deleted: false },\n./voice_cloning/voice_cloning_service.js-103-        { $set: updates },\n./voice_cloning/voice_cloning_service.js-104-        { new: true }\n--\n./voice_cloning/voice_cloning_service.js-122-        userId || filter.userId,\n./voice_cloning/voice_cloning_service.js-123-        'remove a voice clone'\n./voice_cloning/voice_cloning_service.js-124-      )\n./voice_cloning/voice_cloning_service.js:125:      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n./voice_cloning/voice_cloning_service.js-126-        { ...filter, userId: tenantId },\n./voice_cloning/voice_cloning_service.js-127-        { $set: { deleted: true } },\n./voice_cloning/voice_cloning_service.js-128-        { new: true }\n--\n./voice_cloning/voice_cloning_service.js-146-        userId || filter.userId,\n./voice_cloning/voice_cloning_service.js-147-        'remove voice clones'\n./voice_cloning/voice_cloning_service.js-148-      )\n./voice_cloning/voice_cloning_service.js:149:      const updatedModel = await VoiceCloningModel.updateMany(\n./voice_cloning/voice_cloning_service.js-150-        { ...filter, userId: tenantId },\n./voice_cloning/voice_cloning_service.js-151-        { $set: { deleted: true } }\n./voice_cloning/voice_cloning_service.js-152-      )\n--\n./voice_cloning/voice_cloning_service.js-163-\n./voice_cloning/voice_cloning_service.js-164-module.exports = (VoiceCloningModel) => ({\n./voice_cloning/voice_cloning_service.js-165-  create: create(VoiceCloningModel),\n./voice_cloning/voice_cloning_service.js:166:  insertMany: insertMany(VoiceCloningModel),\n./voice_cloning/voice_cloning_service.js-167-  read: read(VoiceCloningModel),\n./voice_cloning/voice_cloning_service.js-168-  remove: remove(VoiceCloningModel),\n./voice_cloning/voice_cloning_service.js-169-  removeMany: removeMany(VoiceCloningModel),\n--\n./user_audio_profile/user_audio_profile_service.js-9-  try {\n./user_audio_profile/user_audio_profile_service.js-10-    requireUserId(data.userId, 'create an audio profile')\n./user_audio_profile/user_audio_profile_service.js-11-    const newModel = new UserAudioProfileModel({ ...data })\n./user_audio_profile/user_audio_profile_service.js:12:    const savedModel = await newModel.save()\n./user_audio_profile/user_audio_profile_service.js-13-    return savedModel\n./user_audio_profile/user_audio_profile_service.js-14-  } catch (error) {\n./user_audio_profile/user_audio_profile_service.js-15-    const details = { data }\n--\n./user_audio_profile/user_audio_profile_service.js-27-      throw new Error('userId is required to create audio profiles')\n./user_audio_profile/user_audio_profile_service.js-28-    }\n./user_audio_profile/user_audio_profile_service.js-29-\n./user_audio_profile/user_audio_profile_service.js:30:    const inserted = await UserAudioProfileModel.insertMany(data)\n./user_audio_profile/user_audio_profile_service.js-31-    return inserted\n./user_audio_profile/user_audio_profile_service.js-32-  } catch (error) {\n./user_audio_profile/user_audio_profile_service.js-33-    const details = { data }\n--\n./user_audio_profile/user_audio_profile_service.js-47-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-48-        'read an audio profile'\n./user_audio_profile/user_audio_profile_service.js-49-      )\n./user_audio_profile/user_audio_profile_service.js:50:      const foundModel = await UserAudioProfileModel.findOne({\n./user_audio_profile/user_audio_profile_service.js-51-        ...filter,\n./user_audio_profile/user_audio_profile_service.js-52-        userId: tenantId,\n./user_audio_profile/user_audio_profile_service.js-53-        deleted: false,\n--\n./user_audio_profile/user_audio_profile_service.js-71-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-72-        'find audio profiles'\n./user_audio_profile/user_audio_profile_service.js-73-      )\n./user_audio_profile/user_audio_profile_service.js:74:      const foundModels = await UserAudioProfileModel.find({\n./user_audio_profile/user_audio_profile_service.js-75-        ...filter,\n./user_audio_profile/user_audio_profile_service.js-76-        userId: tenantId,\n./user_audio_profile/user_audio_profile_service.js-77-        deleted: false,\n--\n./user_audio_profile/user_audio_profile_service.js-98-      const { _id, ...updates } = data\n./user_audio_profile/user_audio_profile_service.js-99-      delete updates.userId\n./user_audio_profile/user_audio_profile_service.js-100-\n./user_audio_profile/user_audio_profile_service.js:101:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js-102-        { _id, userId: tenantId, deleted: false },\n./user_audio_profile/user_audio_profile_service.js-103-        { $set: updates },\n./user_audio_profile/user_audio_profile_service.js-104-        { new: true }\n--\n./user_audio_profile/user_audio_profile_service.js-122-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-123-        'remove an audio profile'\n./user_audio_profile/user_audio_profile_service.js-124-      )\n./user_audio_profile/user_audio_profile_service.js:125:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\n./user_audio_profile/user_audio_profile_service.js-126-        { ...filter, userId: tenantId },\n./user_audio_profile/user_audio_profile_service.js-127-        { $set: { deleted: true } },\n./user_audio_profile/user_audio_profile_service.js-128-        { new: true }\n--\n./user_audio_profile/user_audio_profile_service.js-146-        userId || filter.userId,\n./user_audio_profile/user_audio_profile_service.js-147-        'remove audio profiles'\n./user_audio_profile/user_audio_profile_service.js-148-      )\n./user_audio_profile/user_audio_profile_service.js:149:      const updatedModel = await UserAudioProfileModel.updateMany(\n./user_audio_profile/user_audio_profile_service.js-150-        { ...filter, userId: tenantId },\n./user_audio_profile/user_audio_profile_service.js-151-        { $set: { deleted: true } }\n./user_audio_profile/user_audio_profile_service.js-152-      )\n--\n./user_audio_profile/user_audio_profile_service.js-163-\n./user_audio_profile/user_audio_profile_service.js-164-module.exports = (UserAudioProfileModel) => ({\n./user_audio_profile/user_audio_profile_service.js-165-  create: create(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js:166:  insertMany: insertMany(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js-167-  read: read(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js-168-  remove: remove(UserAudioProfileModel),\n./user_audio_profile/user_audio_profile_service.js-169-  removeMany: removeMany(UserAudioProfileModel),\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_81","type":"command_execution","command":"/bin/bash -lc 'for f in index.js voice_cloning/voice_cloning_service.js user_audio_profile/user_audio_profile_service.js; do node --check \"$f\"; done'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_81","type":"command_execution","command":"/bin/bash -lc 'for f in index.js voice_cloning/voice_cloning_service.js user_audio_profile/user_audio_profile_service.js; do node --check \"$f\"; done'","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_82","type":"command_execution","command":"/bin/bash -lc 'for f in index.js user_audio_profile/user_audio_profile_service.js salutation/salutation_service.js job/job_service.js; do node --check \"$f\"; done'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_82","type":"command_execution","command":"/bin/bash -lc 'for f in index.js user_audio_profile/user_audio_profile_service.js salutation/salutation_service.js job/job_service.js; do node --check \"$f\"; done'","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_83","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,360p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_84","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,430p' index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_83","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,360p' index.js\"","aggregated_output":"const fs = require('fs')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\nconst Bugsnag = require('@bugsnag/js')\nconst uuid = require('uuid').v4\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst userAudioProfileService = require('./user_audio_profile')\nconst recordingModel = require('./recording')\nconst recordingSalutationModel = require('./recording_salutation')\nconst jobService = require('./job')\nconst salutationService = require('./salutation')\nlet throttleMessageFetching = true\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nconst APP_ENV = process.env.POTION_APP_ENV\nconst mongoose = require('mongoose')\n\nfunction execShellCommand(cmd) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while processing python command', error)\n        reject(error)\n      }\n      console.log('Stdout --- ', stdout)\n      console.log('Std error --- ', stderr)\n      resolve(stdout || stderr)\n    })\n  })\n}\n\nasync function connectDB(dbUri, retryCount = 0) {\n  console.log('Connection Attempt : ', retryCount)\n  mongoose.set('strictQuery', true)\n\n  try {\n    await mongoose.connect(dbUri)\n    console.log('Connected to Mongo DB !')\n  } catch (error) {\n    console.log('Failed to connect dns mongo: ', error)\n    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n    throw error\n  }\n}\n\nclass RejectedJobError extends Error {\n  constructor(message) {\n    super(message)\n    this.name = 'RejectedJobError'\n  }\n}\n\nconst validateObjectId = (value, fieldName) => {\n  if (!mongoose.isObjectIdOrHexString(value)) {\n    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n  }\n}\n\nconst validateJob = (job) => {\n  if (!job || typeof job !== 'object') {\n    throw new RejectedJobError('Invalid voice synthesizer job payload')\n  }\n\n  validateObjectId(job.userId, 'userId')\n  validateObjectId(job.userAudioProfileId, 'userAudioProfileId')\n  validateObjectId(job.salutationId, 'salutationId')\n  validateObjectId(job.recordingId, 'recordingId')\n}\n\nconst processQueue = async () => {\n  try {\n    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n    if (\n      typeof response.Messages !== 'undefined' &&\n      response.Messages.length > 0\n    ) {\n      throttleMessageFetching = false\n      const message = response.Messages[0]\n      await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n\n      let job\n      try {\n        job = JSON.parse(message.Body)\n      } catch (error) {\n        throw new RejectedJobError('Invalid JSON in voice synthesizer job')\n      }\n      validateJob(job)\n\n      try {\n        const {\n          userId,\n          userAudioProfileId,\n          text,\n          firstName,\n          salutationId,\n          recordingId,\n          baseUrlForPotionAi,\n          env,\n        } = job\n\n        const DB_URI =\n          env === 'production'\n            ? mongoUriProd\n            : env === 'staging'\n            ? mongoUriStaging\n            : mongoUriDev\n\n        console.log('DB_URI ', DB_URI)\n        await connectDB(DB_URI)\n\n        // read the path for the training model for the this users audio profile\n\n        const userAudioProfile = await userAudioProfileService.read({\n          _id: userAudioProfileId,\n          userId,\n          status: 'completed',\n        })\n        if (userAudioProfile) {\n          const { training_model_path } = userAudioProfile\n\n          const [salutationToUpdate, recordingToUpdate] = await Promise.all([\n            recordingSalutationModel.findOne({\n              _id: salutationId,\n              userId,\n              deleted: false,\n            }),\n            recordingModel.findOne({\n              _id: recordingId,\n              userId,\n              deleted: false,\n            }),\n          ])\n\n          if (!salutationToUpdate || !recordingToUpdate) {\n            throw new RejectedJobError(\n              'Recording data does not belong to the supplied userId'\n            )\n          }\n\n          const {\n            voice_model_light_path,\n            voice_model_config_light_path,\n            voice_model_speakers_file_path, // name for speakers embeddings file path\n          } = training_model_path\n\n          const outputPath = `/tmp/${uuid()}/`\n          if (!fs.existsSync(outputPath)) {\n            fs.mkdirSync(outputPath, { recursive: true })\n          }\n\n          const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n          console.log('AI_COMMAND ', AI_COMMAND)\n\n          const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n          console.time(SYNTHESIZE_AI_LABEL)\n          const aiResponse = await execShellCommand(AI_COMMAND)\n          console.timeEnd(SYNTHESIZE_AI_LABEL)\n\n          let generatedFileName = ''\n          fs.readdirSync(`${outputPath}`).forEach((file) => {\n            if (file.includes('sr48000.wav')) generatedFileName = file\n          })\n\n          // upload the file to s3\n          const uploadParams = {\n            filePath: `${outputPath}${generatedFileName}`,\n            bucket: `recordings-${env}`,\n            fileName: `${uuid()}_salutation_${firstName.replace('-', '_')}.wav`,\n            contentType: 'audio/x-wav',\n            fileType: 'wav',\n          }\n          console.time('Time to Upload video on S3')\n          const greetingUploadResponse = await s3.upload(uploadParams)\n          console.timeEnd('Time to Upload video on S3')\n\n          // Create new entry with the s3 path to salutation collection for the user and its profile id\n          // upsert the salutation\n          await salutationService.updateOrCreate(\n            {\n              firstName: firstName,\n              salutationVideo: greetingUploadResponse,\n              userAudioProfileId,\n            },\n            userId\n          )\n          // update the dynamic recordings for the current dynamic video with salutation url\n          const jobsToInsert = []\n\n          const updatedRecordingSalutation =\n            await recordingSalutationModel.findOneAndUpdate(\n              {\n                _id: salutationId,\n                userId,\n                deleted: false,\n              },\n              {\n                $set: {\n                  salutationVideo: greetingUploadResponse,\n                },\n              },\n              { new: true }\n            )\n\n          if (!updatedRecordingSalutation) {\n            throw new RejectedJobError(\n              'Recording salutation is no longer available for this userId'\n            )\n          }\n\n          const jobData = {\n            originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n            originalVideo:\n              recordingToUpdate.originalVideoUrl ||\n              recordingToUpdate.urls[0].url,\n            cropTimestamp: recordingToUpdate.cropTimestamp,\n            greetingClips: [greetingUploadResponse],\n            greetingObjects: [\n              {\n                greetingId: salutationToUpdate._id,\n                firstName: firstName,\n                videoUrl: greetingUploadResponse,\n              },\n            ],\n            requestOrigin: baseUrlForPotionAi,\n            environment: env,\n            recordingId: recordingToUpdate._id,\n            salutation: salutationToUpdate._id,\n            dynamicVideoType: recordingToUpdate.dynamicVideoType,\n          }\n          jobsToInsert.push({\n            firstName,\n            recordingId: recordingToUpdate._id,\n            userId,\n            salutationId: salutationToUpdate._id,\n            metadata: jobData,\n          })\n\n          // create the job for the ai to create processing\n          if (jobsToInsert.length) {\n            await jobService.insertMany(jobsToInsert)\n          }\n\n          fs.unlinkSync(`${outputPath}${generatedFileName}`)\n          console.log(`[deleted] ${outputPath}${generatedFileName}`)\n        } else {\n          throw new RejectedJobError(\n            'Audio profile does not belong to the supplied userId or is not completed'\n          )\n        }\n      } catch (error) {\n        if (error instanceof RejectedJobError) {\n          console.warn('Rejected voice synthesizer job', {\n            reason: error.message,\n          })\n        } else {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n        }\n      }\n    } else {\n      throttleMessageFetching = true\n    }\n  } catch (error) {\n    if (error instanceof RejectedJobError) {\n      console.warn('Rejected voice synthesizer job', {\n        reason: error.message,\n      })\n    } else {\n      console.error('Error while synthesizing audio', { error })\n      Bugsnag.notify(error)\n    }\n  } finally {\n    try {\n      await mongoose.connection.close()\n    } catch (error) {\n      console.error('Error while closing Mongo DB connection', { error })\n      Bugsnag.notify(error)\n    }\n  }\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_84","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,430p' index.js\"","aggregated_output":"const fs = require('fs')\nconst https = require('https')\nconst exec = require('child_process').exec\nconst AWS = require('aws-sdk')\n\nconst Bugsnag = require('@bugsnag/js')\nconst mongoose = require('mongoose')\nconst version = require('./package.json').version\nconst sqs = require('../app/services/sqs')\nconst s3 = require('../app/services/s3')\nconst voiceCloningService = require('./voice_cloning')\nconst userAudioProfileService = require('./user_audio_profile')\n\nAWS.config.update({ region: 'us-west-2' })\nconst sqsQueueUrl = process.env.SQS_URL\nconst mongoUriDev = process.env.MONGODB_URI_DEV\nconst mongoUriStaging = process.env.MONGODB_URI_STAGING\nconst mongoUriProd = process.env.MONGODB_URI_PROD\nlet throttleMessageFetching = true\nconst APP_ENV = process.env.POTION_APP_ENV\n\nconst cloudFrontUrlProd = process.env.CLOUDFRONT_URL_PROD\nconst cloudFrontUrlDev = process.env.CLOUDFRONT_URL_DEV\nconst cloudFrontUrlStaging = process.env.CLOUDFRONT_URL_STAGING\n\nconst updateUrl = (str, cloudFrontUrl) => {\n  const host = new URL(str).host\n  return str.replace(`https://${host}`, cloudFrontUrl)\n}\n\nasync function connectDB(dbUri, retryCount = 0) {\n  console.log('Connection Attempt : ', retryCount)\n  mongoose.set('strictQuery', true)\n\n  try {\n    await mongoose.connect(dbUri)\n    console.log('Connected to Mongo DB !')\n  } catch (error) {\n    console.log('Failed to connect dns mongo: ', error)\n    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n    throw error\n  }\n}\n\nclass RejectedJobError extends Error {\n  constructor(message) {\n    super(message)\n    this.name = 'RejectedJobError'\n  }\n}\n\nconst validateObjectId = (value, fieldName) => {\n  if (!mongoose.isObjectIdOrHexString(value)) {\n    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n  }\n}\n\nconst getJobContext = (job) => {\n  if (!job || !job._doc || typeof job._doc !== 'object') {\n    throw new RejectedJobError('Invalid voice cloning job payload')\n  }\n\n  const { metadata, input, _id, userAudioProfileId, userId } = job._doc\n\n  validateObjectId(_id, '_id')\n  validateObjectId(userAudioProfileId, 'userAudioProfileId')\n  validateObjectId(userId, 'userId')\n\n  return { metadata, input, _id, userAudioProfileId, userId, env: job.env }\n}\n\nfunction execShellCommand(cmd, logPath) {\n  // const exec = require(\"child_process\").exec;\n  return new Promise((resolve, reject) => {\n    exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n      if (error) {\n        console.log('Error while proccessing python command', error)\n        reject(error)\n      }\n      // console.log('Stdout --- ', stdout)\n      // console.log('Stderror --- ', stderr)\n      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n\n      resolve()\n    })\n  })\n}\n\nasync function getFile(waveUrl, path) {\n  return new Promise((resolve) => {\n    https.get(waveUrl, (res) => {\n      const writeStream = fs.createWriteStream(path)\n\n      res.pipe(writeStream)\n\n      writeStream.on('finish', () => {\n        writeStream.close()\n        resolve()\n      })\n    })\n  })\n}\n\nfunction pad(s) {\n  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n  return s\n}\n\nconst processQueue = async () => {\n  let message\n  let messageDeleted = false\n\n  try {\n    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n\n    if (\n      typeof response.Messages !== 'undefined' &&\n      response.Messages.length > 0\n    ) {\n      throttleMessageFetching = false\n      message = response.Messages[0]\n\n      let job\n      try {\n        job = JSON.parse(message.Body)\n      } catch (error) {\n        throw new RejectedJobError('Invalid JSON in voice cloning job')\n      }\n\n      console.log('job===', job)\n\n      const { metadata, input, _id, userAudioProfileId, userId, env } =\n        getJobContext(job)\n      console.log('userAudioProfileId', userAudioProfileId)\n      console.log('_id', _id)\n      console.log('env', env)\n\n      console.log('metadata------', metadata)\n      console.log('input', input)\n      const DB_URI =\n        env === 'production'\n          ? mongoUriProd\n          : env === 'staging'\n          ? mongoUriStaging\n          : mongoUriDev\n\n      console.log('DB_URI ', DB_URI)\n      await connectDB(DB_URI)\n\n      const [voiceCloningJob, userAudioProfile] = await Promise.all([\n        voiceCloningService.read({\n          _id,\n          userId,\n          userAudioProfileId,\n        }),\n        userAudioProfileService.read({\n          _id: userAudioProfileId,\n          userId,\n        }),\n      ])\n\n      if (!voiceCloningJob || !userAudioProfile) {\n        throw new RejectedJobError(\n          'Voice cloning job does not belong to the supplied userId'\n        )\n      }\n\n      await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n      messageDeleted = true\n\n      const cloudFrontUrl =\n        env === 'production'\n          ? cloudFrontUrlProd\n          : env === 'staging'\n          ? cloudFrontUrlStaging\n          : cloudFrontUrlDev\n\n      try {\n        const { directoryName } = metadata\n        console.log('directoryName', directoryName)\n        const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n        if (!fs.existsSync(logPath)) {\n          fs.mkdirSync(logPath, { recursive: true })\n        }\n        // update the db model to processing\n        await voiceCloningService.update({ _id, status: 'processing' }, userId)\n        await userAudioProfileService.update(\n          {\n            _id: userAudioProfileId,\n            status: 'processing',\n          },\n          userId\n        )\n\n        // create directory for userid-useraudioprofileid if not exist\n        const rootPath = `/tmp/${directoryName}`\n        const wavePath = `${rootPath}/wav48/1`\n        if (!fs.existsSync(wavePath)) {\n          fs.mkdirSync(wavePath, { recursive: true })\n        }\n\n        const txtPath = `${rootPath}/txt/1`\n        if (!fs.existsSync(txtPath)) {\n          fs.mkdirSync(txtPath, { recursive: true })\n        }\n        // download the training data files and put it in respective directories\n        for (let index = 0; index < input.length; index++) {\n          const item = input[index]\n\n          const { waveUrl, originalText } = item\n          // download wave file\n          const waveFilePath = `${wavePath}/1_${pad('' + (index + 1))}.wav`\n\n          await getFile(updateUrl(waveUrl, cloudFrontUrl), waveFilePath)\n\n          const txtFilePath = `${txtPath}/1_${pad('' + (index + 1))}.txt`\n          await fs.promises.writeFile(txtFilePath, originalText)\n        }\n\n        const zipFileName = directoryName + '.tgz'\n\n        // /tmp/directoryName.tgz\n\n        await execShellCommand(\n          `cd /tmp && tar czvf ${zipFileName}  ${directoryName}`,\n          logPath\n        )\n        console.log('ZIP created ', zipFileName)\n\n        // re-sample audio\n        const SAMPLING_LABEL = `Time Taken for re-sampling ${directoryName}`\n        console.time(SAMPLING_LABEL)\n\n        const outputPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n\n        const samplingCommand = `python3 ../voice-cloning/prepare_datasets.py --dataset_preset potion_voice_cloning --dataset_archive_path /tmp/${zipFileName} --output_path ${outputPath}`\n        console.log('samplingCommand ', samplingCommand)\n        const samplingResponse = await execShellCommand(\n          samplingCommand,\n          logPath\n        )\n        console.timeEnd(SAMPLING_LABEL)\n\n        // /mnt/efs/potion-voice/${env}/speakrs.pth\n        // /mnt/efs/potion-voice/${env}/txt\n        // /mnt/efs/potion-voice/${env}/${directoryName}/wav\n\n        const outPath = `/mnt/efs/potion-voice/${env}/${directoryName}/sr22050/${directoryName}`\n\n        const resultsPath = outPath + '/results'\n\n        //update pth file for cloning\n        // clone the voice\n        const VOICE_CLONING_LABEL = `Time Taken for voice cloning ${directoryName}`\n        console.time(VOICE_CLONING_LABEL)\n        const trainingModelCommand = `python3 ../voice-cloning/clone_voice.py --baseline_model_path ../voice-cloning/pretrained-models/checkpoint_365000.pth --speaker_dataset_path ${outPath} --speaker_embeddings_path ${\n          outPath + '/speakers.pth'\n        } --output_path ${resultsPath}`\n\n        console.log('Training Model Command', trainingModelCommand)\n        const trainingResponse = await execShellCommand(\n          trainingModelCommand,\n          logPath\n        )\n\n        console.timeEnd(VOICE_CLONING_LABEL)\n\n        let generatedDirectoryName = ''\n        fs.readdirSync(`${resultsPath}/`).forEach((file) => {\n          if (file.includes('vits_potion_clone'))\n            // use output from above to get right path and directory name\n            generatedDirectoryName = file\n        })\n\n        // minimize cloning model\n        const VOICE_MINIMIZE_LABEL = `Time Taken for voice minimizing cloning ${directoryName}`\n        console.time(VOICE_MINIMIZE_LABEL)\n        const minimizeCloningModelCommand = `python3 ../voice-cloning/minimize_cloned_voice_model.py --voice_model_asset_path ${\n          resultsPath + '/' + generatedDirectoryName + '/'\n        } --voice_model_name checkpoint_365200.pth`\n\n        console.log(\n          'Minimize Cloning Model Command',\n          minimizeCloningModelCommand\n        )\n        const minimizeCloning = await execShellCommand(\n          minimizeCloningModelCommand,\n          logPath\n        )\n        console.timeEnd(VOICE_MINIMIZE_LABEL)\n\n        // Add the  code to update location of generated model and status into DB\n        await voiceCloningService.update({ _id, status: 'completed' }, userId)\n\n        const training_model_path = {\n          voice_model_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200.pth`,\n          voice_model_config_path: `${resultsPath}/${generatedDirectoryName}/config.json`,\n          voice_model_speakers_file_path: `${outPath}/speakers.pth`, // TODO update the name to voice model speakers embeddings\n          voice_model_light_path: `${resultsPath}/${generatedDirectoryName}/checkpoint_365200_light.pth`,\n          voice_model_config_light_path: `${resultsPath}/${generatedDirectoryName}/config_light.json`,\n        }\n\n        await userAudioProfileService.update(\n          {\n            _id: userAudioProfileId,\n            status: 'completed',\n            training_model_path,\n          },\n          userId\n        )\n\n        // add code to put that model into S3\n        let keys = Object.keys(training_model_path)\n\n        const training_model_s3_path = {}\n\n        for (let index = 0; index < keys.length; index++) {\n          const path = training_model_path[keys[index]]\n          const s3Path = await s3.upload({\n            filePath: path,\n            fileName: `${directoryName}/${path.split('/').pop()}`,\n            bucket: `potion-voice-users-training-model/${env}`,\n          })\n          training_model_s3_path[keys[index]] = s3Path\n        }\n        //  add S3 path to user audio profile model\n        await userAudioProfileService.update(\n          {\n            _id: userAudioProfileId,\n            training_model_s3_path,\n          },\n          userId\n        )\n      } catch (error) {\n        console.log('error********************', error)\n        Bugsnag.notify(\n          new Error(\n            `Unable to train for voice cloning videos ` + JSON.stringify(job)\n          )\n        )\n        Bugsnag.notify(error)\n\n        // Keep failure handling tenant-scoped and do not let a secondary\n        // status update failure stop the polling loop.\n        await Promise.allSettled([\n          voiceCloningService.update({ _id, status: 'error' }, userId),\n          userAudioProfileService.update(\n            {\n              _id: userAudioProfileId,\n              status: 'error',\n            },\n            userId\n          ),\n        ])\n      }\n    } else {\n      throttleMessageFetching = true\n    }\n  } catch (error) {\n    if (error instanceof RejectedJobError) {\n      if (message && !messageDeleted) {\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n        } catch (deleteError) {\n          console.error('Unable to delete rejected voice cloning job', {\n            error: deleteError,\n          })\n          Bugsnag.notify(deleteError)\n        }\n      }\n      console.warn('Rejected voice cloning job', { reason: error.message })\n    } else {\n      console.error('Error while training voice clone', { error })\n      Bugsnag.notify(error)\n    }\n  } finally {\n    try {\n      await mongoose.connection.close()\n    } catch (error) {\n      console.error('Error while closing Mongo DB connection', { error })\n      Bugsnag.notify(error)\n    }\n  }\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  console.log('potion Voice Clone Process Started')\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n\n  try {\n    while (true) {\n      await processQueue()\n      if (throttleMessageFetching) await sleep(2000)\n    }\n  } catch (error) {\n    Bugsnag.notify(error)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_85","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,210p' salutation/salutation_service.js && sed -n '1,220p' job/job_service.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_85","type":"command_execution","command":"/bin/bash -lc \"sed -n '1,210p' salutation/salutation_service.js && sed -n '1,220p' job/job_service.js\"","aggregated_output":"const requireUserId = (userId, operation) => {\n  if (!userId) throw new Error(`userId is required to ${operation}`)\n  return userId\n}\n\nconst getUpdates = (data) => {\n  const updates =\n    typeof data.toObject === 'function' ? data.toObject() : { ...data }\n  delete updates._id\n  delete updates.userId\n  return updates\n}\n\nconst create = (Salutation) => async (salutationData, userId) => {\n  const tenantId = requireUserId(userId, 'create a salutation')\n  const newSalutation = new Salutation({\n    ...salutationData,\n    userId: tenantId,\n  })\n  const savedSalutation = await newSalutation.save()\n  return savedSalutation\n}\n\nconst read =\n  (Salutation) =>\n  async (filter = {}, userId) => {\n    const tenantId = requireUserId(userId || filter.userId, 'read a salutation')\n    const foundSalutation = await Salutation.findOne({\n      ...filter,\n      userId: tenantId,\n      deleted: false,\n    })\n    return foundSalutation\n  }\n\nconst find =\n  (Salutation) =>\n  async (filter = {}, userId) => {\n    const tenantId = requireUserId(userId || filter.userId, 'find salutations')\n    const foundSalutations = await Salutation.find({\n      ...filter,\n      userId: tenantId,\n      deleted: false,\n    })\n    return foundSalutations\n  }\n\nconst update = (Salutation) => async (salutation, userId) => {\n  const tenantId = requireUserId(userId, 'update a salutation')\n  const updatedSalutation = await Salutation.findOneAndUpdate(\n    { _id: salutation._id, userId: tenantId, deleted: false },\n    { $set: getUpdates(salutation) },\n    { new: true }\n  )\n  return updatedSalutation\n}\n\nconst modify =\n  (Salutation) =>\n  async (salutation = {}, userId) => {\n    const tenantId = requireUserId(\n      userId || salutation.userId,\n      'modify a salutation'\n    )\n    const findQuery = salutation._id\n      ? { _id: salutation._id, userId: tenantId, deleted: false }\n      : {\n          transcriptId: salutation.transcriptId,\n          userId: tenantId,\n          deleted: false,\n        }\n\n    const updatedSalutation = await Salutation.findOneAndUpdate(\n      findQuery,\n      { $set: getUpdates(salutation) },\n      { new: true }\n    )\n    return updatedSalutation\n  }\n\nconst updateOrCreate =\n  (Salutation) =>\n  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\n    const tenantId = requireUserId(userId, 'upsert a salutation')\n    const salutation = await read(Salutation)(\n      { firstName, userAudioProfileId },\n      tenantId\n    )\n\n    if (salutation) {\n      salutation.salutationVideo = salutationVideo\n      return update(Salutation)(salutation, tenantId)\n    }\n\n    return create(Salutation)(\n      { firstName, salutationVideo, userAudioProfileId },\n      tenantId\n    )\n  }\n\nconst remove =\n  (Salutation) =>\n  async (filter = {}, userId) => {\n    const tenantId = requireUserId(\n      userId || filter.userId,\n      'remove a salutation'\n    )\n    const updatedSalutation = await Salutation.findOneAndUpdate(\n      { ...filter, userId: tenantId, deleted: false },\n      { $set: { deleted: true } },\n      { new: true }\n    )\n    return updatedSalutation\n  }\n\nmodule.exports = (Salutation) => ({\n  create: create(Salutation),\n  read: read(Salutation),\n  remove: remove(Salutation),\n  update: update(Salutation),\n  updateOrCreate: updateOrCreate(Salutation),\n  find: find(Salutation),\n  modify: modify(Salutation),\n})\nconst StringifyUtils = require('../../app/services/utils/logService')\n\nconst create = (Job) => async (jobData) => {\n  try {\n    if (!jobData.userId) throw new Error('userId is required to create a job')\n\n    const newJob = new Job({ ...jobData })\n    const savedJob = await newJob.save()\n    return savedJob\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > create',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst insertMany = (Job) => async (jobData) => {\n  try {\n    if (!jobData.every((job) => job.userId))\n      throw new Error('userId is required to create jobs')\n\n    const inserted = await Job.insertMany(jobData)\n    return inserted\n  } catch (error) {\n    const details = { jobData }\n    console.log(\n      'ERROR - JOB SERVICE > insertMany',\n      StringifyUtils.potionErrorObj(error, details)\n    )\n    throw error\n  }\n}\n\nconst read =\n  (Job) =>\n  async (filter, userId = filter.userId) => {\n    try {\n      if (!userId) throw new Error('userId is required to read a job')\n\n      const foundJob = await Job.findOne({\n        ...filter,\n        userId,\n        deleted: false,\n      })\n      return foundJob\n    } catch (error) {\n      const details = { filter }\n      console.log(\n        'ERROR - JOB SERVICE > read',\n        StringifyUtils.potionErrorObj(error, details)\n      )\n      throw error\n    }\n  }\n\nconst find =\n  (Job) =>\n  async (filter, userId = filter.userId) => {\n    try {\n      if (!userId) throw new Error('userId is required to find jobs')\n\n      const foundJobs = await Job.find({\n        ...filter,\n        userId,\n        deleted: false,\n      })\n      return foundJobs\n    } catch (error) {\n      const details = { filter }\n      console.log(\n        'ERROR - JOB SERVICE > find',\n        StringifyUtils.potionErrorObj(error, details)\n      )\n      throw error\n    }\n  }\n\nconst update =\n  (Job) =>\n  async (job, userId = job.userId) => {\n    try {\n      if (!userId) throw new Error('userId is required to update a job')\n\n      const { _id, ...updates } = job\n      delete updates.userId\n      const updatedJob = await Job.findOneAndUpdate(\n        { _id, userId, deleted: false },\n        { $set: updates },\n        {\n          new: true,\n        }\n      )\n      return updatedJob\n    } catch (error) {\n      const details = { job }\n      console.log(\n        'ERROR - JOB SERVICE > update',\n        StringifyUtils.potionErrorObj(error, details)\n      )\n      throw error\n    }\n  }\n\nconst remove =\n  (Job) =>\n  async (filter, userId = filter.userId) => {\n    try {\n      if (!userId) throw new Error('userId is required to remove a job')\n\n      const updatedJob = await Job.findOneAndUpdate(\n        { ...filter, userId },\n        {\n          $set: {\n            deleted: true,\n          },\n        },\n        { new: true }\n      )\n      return updatedJob\n    } catch (error) {\n      const details = { filter }\n      console.log(\n        'ERROR - JOB SERVICE > remove',\n        StringifyUtils.potionErrorObj(error, details)\n      )\n      throw error\n    }\n  }\n\nconst removeMany =\n  (Job) =>\n  async (filter, userId = filter.userId) => {\n    try {\n      if (!userId) throw new Error('userId is required to remove jobs')\n\n      const updatedJob = await Job.updateMany(\n        { ...filter, userId },\n        {\n          $set: {\n            deleted: true,\n          },\n        },\n        { new: true }\n      )\n      return updatedJob\n    } catch (error) {\n      const details = { filter }\n      console.log(\n        'ERROR - JOB SERVICE > removeMany',\n        StringifyUtils.potionErrorObj(error, details)\n      )\n      throw error\n    }\n  }\n\nmodule.exports = (Job) => {\n  return {\n    create: create(Job),\n    insertMany: insertMany(Job),\n    read: read(Job),\n    remove: remove(Job),\n    removeMany: removeMany(Job),\n    update: update(Job),\n    find: find(Job),\n  }\n}\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_86","type":"command_execution","command":"/bin/bash -lc \"node <<'NODE'\nconst assert = require('assert')\n\nasync function verifyCrud(factoryPath) {\n  const calls = {}\n  function Model() {}\n  Model.findOne = async (filter) => { calls.read = filter; return {} }\n  Model.find = async (filter) => { calls.find = filter; return [] }\n  Model.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  Model.updateMany = async (...args) => { calls.updateMany = args; return {} }\n  const service = require(factoryPath)(Model)\n\n  await service.read({ _id: 'document', userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await service.find({ userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.find.userId, 'tenant')\n  await service.update({ _id: 'document', userId: 'wrong', status: 'done' }, 'tenant')\n  assert.deepStrictEqual(calls.update[0], { _id: 'document', userId: 'tenant', deleted: false })\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n  await service.remove({ _id: '\"'document', userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n  await assert.rejects(service.read({ _id: 'document' }), /userId is required/)\n}\n\nasync function main() {\n  await verifyCrud('./voice-cloning-job-handler/voice_cloning/voice_cloning_service')\n  await verifyCrud('./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service')\n  await verifyCrud('./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service')\n\n  const calls = {}\n  function Salutation() {}\n  Salutation.findOne = async (filter) => { calls.read = filter; return null }\n  Salutation.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  const salutations = require('./voice-synthsizer-job-handler/salutation/salutation_service')(Salutation)\n  await salutations.read({ _id: 'document', userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await salutations.modify({ _id: 'document', userId: 'wrong', firstName: 'A' }, 'tenant')\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n\n  process.stdout.write('\"'tenant service checks passed\\\\n')\n}\n\nmain().catch((error) => { console.error(error); process.exitCode = 1 })\nNODE\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_86","type":"command_execution","command":"/bin/bash -lc \"node <<'NODE'\nconst assert = require('assert')\n\nasync function verifyCrud(factoryPath) {\n  const calls = {}\n  function Model() {}\n  Model.findOne = async (filter) => { calls.read = filter; return {} }\n  Model.find = async (filter) => { calls.find = filter; return [] }\n  Model.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  Model.updateMany = async (...args) => { calls.updateMany = args; return {} }\n  const service = require(factoryPath)(Model)\n\n  await service.read({ _id: 'document', userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await service.find({ userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.find.userId, 'tenant')\n  await service.update({ _id: 'document', userId: 'wrong', status: 'done' }, 'tenant')\n  assert.deepStrictEqual(calls.update[0], { _id: 'document', userId: 'tenant', deleted: false })\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n  await service.remove({ _id: '\"'document', userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n  await assert.rejects(service.read({ _id: 'document' }), /userId is required/)\n}\n\nasync function main() {\n  await verifyCrud('./voice-cloning-job-handler/voice_cloning/voice_cloning_service')\n  await verifyCrud('./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service')\n  await verifyCrud('./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service')\n\n  const calls = {}\n  function Salutation() {}\n  Salutation.findOne = async (filter) => { calls.read = filter; return null }\n  Salutation.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  const salutations = require('./voice-synthsizer-job-handler/salutation/salutation_service')(Salutation)\n  await salutations.read({ _id: 'document', userId: 'wrong' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await salutations.modify({ _id: 'document', userId: 'wrong', firstName: 'A' }, 'tenant')\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n\n  process.stdout.write('\"'tenant service checks passed\\\\n')\n}\n\nmain().catch((error) => { console.error(error); process.exitCode = 1 })\nNODE\"","aggregated_output":"ERROR - VOICE CLONING SERVICE > read {\"error\":\"{\\\"stack\\\":\\\"Error: userId is required to read a voice clone\\\\n    at requireUserId (/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:4:22)\\\\n    at Object.read (/workspace/voice-cloning-job-handler/voice_cloning/voice_cloning_service.js:46:24)\\\\n    at verifyCrud ([stdin]:21:32)\\\\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\\\\n    at async main ([stdin]:25:3)\\\",\\\"message\\\":\\\"userId is required to read a voice clone\\\"}\",\"details\":{\"filter\":{\"_id\":\"document\"}}}\nERROR - USER AUDIO PROFILE SERVICE > read {\"error\":\"{\\\"stack\\\":\\\"Error: userId is required to read an audio profile\\\\n    at requireUserId (/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:4:22)\\\\n    at Object.read (/workspace/voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:46:24)\\\\n    at verifyCrud ([stdin]:21:32)\\\\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\\\\n    at async main ([stdin]:26:3)\\\",\\\"message\\\":\\\"userId is required to read an audio profile\\\"}\",\"details\":{\"filter\":{\"_id\":\"document\"}}}\nERROR - USER AUDIO PROFILE SERVICE > read {\"error\":\"{\\\"stack\\\":\\\"Error: userId is required to read an audio profile\\\\n    at requireUserId (/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:4:22)\\\\n    at Object.read (/workspace/voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:46:24)\\\\n    at verifyCrud ([stdin]:21:32)\\\\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\\\\n    at async main ([stdin]:27:3)\\\",\\\"message\\\":\\\"userId is required to read an audio profile\\\"}\",\"details\":{\"filter\":{\"_id\":\"document\"}}}\ntenant service checks passed\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_87","type":"command_execution","command":"/bin/bash -lc \"git diff -- voice-synthsizer-job-handler/index.js | sed -n '1,420p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_87","type":"command_execution","command":"/bin/bash -lc \"git diff -- voice-synthsizer-job-handler/index.js | sed -n '1,420p'\"","aggregated_output":"diff --git a/voice-synthsizer-job-handler/index.js b/voice-synthsizer-job-handler/index.js\nindex 862300f..364ed67 100644\n--- a/voice-synthsizer-job-handler/index.js\n+++ b/voice-synthsizer-job-handler/index.js\n@@ -35,213 +35,258 @@ function execShellCommand(cmd) {\n   })\n }\n \n-function connectDB(dbUri, retryCount = 0) {\n-  return new Promise((resolve, reject) => {\n-    console.log('Connection Attempt : ', retryCount)\n-    mongoose.set('strictQuery', true)\n-    mongoose\n-      .connect(dbUri)\n-      .then((msg) => {\n-        console.log('Connected to Mongo DB !')\n-        resolve()\n-      })\n-      .catch((err) => {\n-        console.log('Failed to connect dns mongo: ', err)\n-        if (retryCount < 6) {\n-          retryCount++\n-          connectDB(dbUri, retryCount)\n-        }\n-      })\n-  })\n+async function connectDB(dbUri, retryCount = 0) {\n+  console.log('Connection Attempt : ', retryCount)\n+  mongoose.set('strictQuery', true)\n+\n+  try {\n+    await mongoose.connect(dbUri)\n+    console.log('Connected to Mongo DB !')\n+  } catch (error) {\n+    console.log('Failed to connect dns mongo: ', error)\n+    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n+    throw error\n+  }\n }\n \n-const processQueue = () => {\n-  /* eslint-disable no-async-promise-executor */\n-  return new Promise(async (resolve, reject) => {\n-    try {\n-      const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n+class RejectedJobError extends Error {\n+  constructor(message) {\n+    super(message)\n+    this.name = 'RejectedJobError'\n+  }\n+}\n \n-      if (\n-        typeof response.Messages !== 'undefined' &&\n-        response.Messages.length > 0\n-      ) {\n-        throttleMessageFetching = false\n-        const job = JSON.parse(response.Messages[0].Body)\n-        const receiptHandle = response.Messages[0].ReceiptHandle\n-        try {\n-          await sqs.deleteMessageFromSQS(sqsQueueUrl, receiptHandle)\n+const validateObjectId = (value, fieldName) => {\n+  if (!mongoose.isObjectIdOrHexString(value)) {\n+    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n+  }\n+}\n \n-          const {\n-            userAudioProfileId,\n-            text,\n-            firstName,\n-            salutationId,\n-            recordingId,\n-            baseUrlForPotionAi,\n-            env,\n-          } = job\n+const validateJob = (job) => {\n+  if (!job || typeof job !== 'object') {\n+    throw new RejectedJobError('Invalid voice synthesizer job payload')\n+  }\n \n-          const DB_URI =\n-            env === 'production'\n-              ? mongoUriProd\n-              : env === 'staging'\n-              ? mongoUriStaging\n-              : mongoUriDev\n+  validateObjectId(job.userId, 'userId')\n+  validateObjectId(job.userAudioProfileId, 'userAudioProfileId')\n+  validateObjectId(job.salutationId, 'salutationId')\n+  validateObjectId(job.recordingId, 'recordingId')\n+}\n \n-          console.log('DB_URI ', DB_URI)\n-          await connectDB(DB_URI)\n+const processQueue = async () => {\n+  try {\n+    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n \n-          // read the path for the training model for the this users audio profile\n+    if (\n+      typeof response.Messages !== 'undefined' &&\n+      response.Messages.length > 0\n+    ) {\n+      throttleMessageFetching = false\n+      const message = response.Messages[0]\n+      await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n \n-          const userAudioProfile = await userAudioProfileService.find({\n-            _id: userAudioProfileId,\n-            status: 'completed',\n-          })\n-          if (userAudioProfile) {\n-            const { training_model_path, userId } = userAudioProfile[0]\n-            const {\n-              voice_model_light_path,\n-              voice_model_config_light_path,\n-              voice_model_speakers_file_path, // name for speakers embeddings file path\n-            } = training_model_path\n+      let job\n+      try {\n+        job = JSON.parse(message.Body)\n+      } catch (error) {\n+        throw new RejectedJobError('Invalid JSON in voice synthesizer job')\n+      }\n+      validateJob(job)\n \n-            const outputPath = `/tmp/${uuid()}/`\n-            if (!fs.existsSync(outputPath)) {\n-              fs.mkdirSync(outputPath, { recursive: true })\n-            }\n+      try {\n+        const {\n+          userId,\n+          userAudioProfileId,\n+          text,\n+          firstName,\n+          salutationId,\n+          recordingId,\n+          baseUrlForPotionAi,\n+          env,\n+        } = job\n \n-            const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n-            console.log('AI_COMMAND ', AI_COMMAND)\n+        const DB_URI =\n+          env === 'production'\n+            ? mongoUriProd\n+            : env === 'staging'\n+            ? mongoUriStaging\n+            : mongoUriDev\n \n-            const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n-            console.time(SYNTHESIZE_AI_LABEL)\n-            const aiResponse = await execShellCommand(AI_COMMAND)\n-            console.timeEnd(SYNTHESIZE_AI_LABEL)\n+        console.log('DB_URI ', DB_URI)\n+        await connectDB(DB_URI)\n \n-            let generatedFileName = ''\n-            fs.readdirSync(`${outputPath}`).forEach((file) => {\n-              if (file.includes('sr48000.wav')) generatedFileName = file\n-            })\n+        // read the path for the training model for the this users audio profile\n \n-            // upload the file to s3\n-            const uploadParams = {\n-              filePath: `${outputPath}${generatedFileName}`,\n-              bucket: `recordings-${env}`,\n-              fileName: `${uuid()}_salutation_${firstName.replace(\n-                '-',\n-                '_'\n-              )}.wav`,\n-              contentType: 'audio/x-wav',\n-              fileType: 'wav',\n-            }\n-            console.time('Time to Upload video on S3')\n-            const greetingUploadResponse = await s3.upload(uploadParams)\n-            console.timeEnd('Time to Upload video on S3')\n+        const userAudioProfile = await userAudioProfileService.read({\n+          _id: userAudioProfileId,\n+          userId,\n+          status: 'completed',\n+        })\n+        if (userAudioProfile) {\n+          const { training_model_path } = userAudioProfile\n \n-            // Create new entry with the s3 path to salutation collection for the user and its profile id\n-            // upsert the salutation\n-            await salutationService.updateOrCreate(\n-              {\n-                firstName: firstName,\n-                salutationVideo: greetingUploadResponse,\n-                userAudioProfileId,\n-              },\n-              userId\n-            )\n-            // update the dynamic recordings for the current dynamic video with salutation url\n-            const salutationToUpdate = await recordingSalutationModel.findOne({\n+          const [salutationToUpdate, recordingToUpdate] = await Promise.all([\n+            recordingSalutationModel.findOne({\n               _id: salutationId,\n+              userId,\n               deleted: false,\n-            })\n-\n-            const recordingToUpdate = await recordingModel.findOne({\n+            }),\n+            recordingModel.findOne({\n               _id: recordingId,\n+              userId,\n               deleted: false,\n-            })\n+            }),\n+          ])\n \n-            if (\n-              salutationToUpdate &&\n-              salutationToUpdate.deleted === false &&\n-              recordingToUpdate\n-            ) {\n-              const jobsToInsert = []\n+          if (!salutationToUpdate || !recordingToUpdate) {\n+            throw new RejectedJobError(\n+              'Recording data does not belong to the supplied userId'\n+            )\n+          }\n \n-              await recordingSalutationModel.findOneAndUpdate(\n-                {\n-                  _id: salutationId,\n-                },\n-                {\n-                  $set: {\n-                    salutationVideo: greetingUploadResponse,\n-                  },\n-                }\n-              )\n+          const {\n+            voice_model_light_path,\n+            voice_model_config_light_path,\n+            voice_model_speakers_file_path, // name for speakers embeddings file path\n+          } = training_model_path\n \n-              const jobData = {\n-                originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n-                originalVideo:\n-                  recordingToUpdate.originalVideoUrl ||\n-                  recordingToUpdate.urls[0].url,\n-                cropTimestamp: recordingToUpdate.cropTimestamp,\n-                greetingClips: [greetingUploadResponse],\n-                greetingObjects: [\n-                  {\n-                    greetingId: salutationToUpdate._id,\n-                    firstName: firstName,\n-                    videoUrl: greetingUploadResponse,\n-                  },\n-                ],\n-                requestOrigin: baseUrlForPotionAi,\n-                environment: env,\n-                recordingId: recordingToUpdate._id,\n-                salutation: salutationToUpdate._id,\n-                dynamicVideoType: recordingToUpdate.dynamicVideoType,\n-              }\n-              jobsToInsert.push({\n-                firstName,\n-                recordingId: recordingToUpdate._id,\n-                userId: recordingToUpdate.userId,\n-                salutationId: salutationToUpdate._id,\n-                metadata: jobData,\n-              })\n+          const outputPath = `/tmp/${uuid()}/`\n+          if (!fs.existsSync(outputPath)) {\n+            fs.mkdirSync(outputPath, { recursive: true })\n+          }\n+\n+          const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n+          console.log('AI_COMMAND ', AI_COMMAND)\n \n-              // create the job for the ai to create processing\n-              if (jobsToInsert.length) {\n-                await jobService.insertMany(jobsToInsert)\n-              }\n-            }\n+          const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n+          console.time(SYNTHESIZE_AI_LABEL)\n+          const aiResponse = await execShellCommand(AI_COMMAND)\n+          console.timeEnd(SYNTHESIZE_AI_LABEL)\n+\n+          let generatedFileName = ''\n+          fs.readdirSync(`${outputPath}`).forEach((file) => {\n+            if (file.includes('sr48000.wav')) generatedFileName = file\n+          })\n \n-            fs.unlinkSync(`${outputPath}${generatedFileName}`)\n-            console.log(`[deleted] ${outputPath}${generatedFileName}`)\n-          } else {\n-            Bugsnag.notify(\n-              new Error(\n-                `audio profile training model not found ` + JSON.stringify(job)\n-              )\n+          // upload the file to s3\n+          const uploadParams = {\n+            filePath: `${outputPath}${generatedFileName}`,\n+            bucket: `recordings-${env}`,\n+            fileName: `${uuid()}_salutation_${firstName.replace('-', '_')}.wav`,\n+            contentType: 'audio/x-wav',\n+            fileType: 'wav',\n+          }\n+          console.time('Time to Upload video on S3')\n+          const greetingUploadResponse = await s3.upload(uploadParams)\n+          console.timeEnd('Time to Upload video on S3')\n+\n+          // Create new entry with the s3 path to salutation collection for the user and its profile id\n+          // upsert the salutation\n+          await salutationService.updateOrCreate(\n+            {\n+              firstName: firstName,\n+              salutationVideo: greetingUploadResponse,\n+              userAudioProfileId,\n+            },\n+            userId\n+          )\n+          // update the dynamic recordings for the current dynamic video with salutation url\n+          const jobsToInsert = []\n+\n+          const updatedRecordingSalutation =\n+            await recordingSalutationModel.findOneAndUpdate(\n+              {\n+                _id: salutationId,\n+                userId,\n+                deleted: false,\n+              },\n+              {\n+                $set: {\n+                  salutationVideo: greetingUploadResponse,\n+                },\n+              },\n+              { new: true }\n             )\n \n-            resolve() // to continue working on new jobs\n+          if (!updatedRecordingSalutation) {\n+            throw new RejectedJobError(\n+              'Recording salutation is no longer available for this userId'\n+            )\n+          }\n+\n+          const jobData = {\n+            originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n+            originalVideo:\n+              recordingToUpdate.originalVideoUrl ||\n+              recordingToUpdate.urls[0].url,\n+            cropTimestamp: recordingToUpdate.cropTimestamp,\n+            greetingClips: [greetingUploadResponse],\n+            greetingObjects: [\n+              {\n+                greetingId: salutationToUpdate._id,\n+                firstName: firstName,\n+                videoUrl: greetingUploadResponse,\n+              },\n+            ],\n+            requestOrigin: baseUrlForPotionAi,\n+            environment: env,\n+            recordingId: recordingToUpdate._id,\n+            salutation: salutationToUpdate._id,\n+            dynamicVideoType: recordingToUpdate.dynamicVideoType,\n           }\n-        } catch (error) {\n+          jobsToInsert.push({\n+            firstName,\n+            recordingId: recordingToUpdate._id,\n+            userId,\n+            salutationId: salutationToUpdate._id,\n+            metadata: jobData,\n+          })\n+\n+          // create the job for the ai to create processing\n+          if (jobsToInsert.length) {\n+            await jobService.insertMany(jobsToInsert)\n+          }\n+\n+          fs.unlinkSync(`${outputPath}${generatedFileName}`)\n+          console.log(`[deleted] ${outputPath}${generatedFileName}`)\n+        } else {\n+          throw new RejectedJobError(\n+            'Audio profile does not belong to the supplied userId or is not completed'\n+          )\n+        }\n+      } catch (error) {\n+        if (error instanceof RejectedJobError) {\n+          console.warn('Rejected voice synthesizer job', {\n+            reason: error.message,\n+          })\n+        } else {\n           console.error('Error while synthesizing audio', { error })\n           Bugsnag.notify(\n             new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n           )\n           Bugsnag.notify(error)\n-          resolve() // to continue working on new jobs\n         }\n-      } else {\n-        throttleMessageFetching = true\n       }\n-      resolve()\n-    } catch (error) {\n+    } else {\n+      throttleMessageFetching = true\n+    }\n+  } catch (error) {\n+    if (error instanceof RejectedJobError) {\n+      console.warn('Rejected voice synthesizer job', {\n+        reason: error.message,\n+      })\n+    } else {\n       console.error('Error while synthesizing audio', { error })\n       Bugsnag.notify(error)\n-      resolve() // to continue working on new jobs\n-    } finally {\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_88","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_88","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_89","type":"command_execution","command":"/bin/bash -lc 'git diff --stat -w && git diff --numstat -w'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_89","type":"command_execution","command":"/bin/bash -lc 'git diff --stat -w && git diff --numstat -w'","aggregated_output":" voice-cloning-job-handler/index.js                 | 166 +++++++++++++++------\n .../user_audio_profile_service.js                  |  86 +++++++----\n .../voice_cloning/voice_cloning_service.js         |  87 +++++++----\n voice-synthsizer-job-handler/index.js              | 162 +++++++++++++-------\n voice-synthsizer-job-handler/job/job_service.js    |  51 +++++--\n .../salutation/salutation_service.js               |  97 ++++++++----\n .../user_audio_profile_service.js                  |  94 ++++++++----\n 7 files changed, 515 insertions(+), 228 deletions(-)\n122\t44\tvoice-cloning-job-handler/index.js\n59\t27\tvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n59\t28\tvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n104\t58\tvoice-synthsizer-job-handler/index.js\n42\t9\tvoice-synthsizer-job-handler/job/job_service.js\n67\t30\tvoice-synthsizer-job-handler/salutation/salutation_service.js\n62\t32\tvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_90","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"(voiceCloningService|userAudioProfileService|salutationService|jobService)\\\\.(read|find|update|remove|removeMany|create|insertMany|updateOrCreate|modify)\\\" -g '*.js' .\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_90","type":"command_execution","command":"/bin/bash -lc \"rg -n \\\"(voiceCloningService|userAudioProfileService|salutationService|jobService)\\\\.(read|find|update|remove|removeMany|create|insertMany|updateOrCreate|modify)\\\" -g '*.js' .\"","aggregated_output":"./voice-cloning-job-handler/index.js:152:        voiceCloningService.read({\n./voice-cloning-job-handler/index.js:157:        userAudioProfileService.read({\n./voice-cloning-job-handler/index.js:187:        await voiceCloningService.update({ _id, status: 'processing' }, userId)\n./voice-cloning-job-handler/index.js:188:        await userAudioProfileService.update(\n./voice-cloning-job-handler/index.js:294:        await voiceCloningService.update({ _id, status: 'completed' }, userId)\n./voice-cloning-job-handler/index.js:304:        await userAudioProfileService.update(\n./voice-cloning-job-handler/index.js:328:        await userAudioProfileService.update(\n./voice-cloning-job-handler/index.js:347:          voiceCloningService.update({ _id, status: 'error' }, userId),\n./voice-cloning-job-handler/index.js:348:          userAudioProfileService.update(\n./voice-synthsizer-job-handler/index.js:120:        const userAudioProfile = await userAudioProfileService.read({\n./voice-synthsizer-job-handler/index.js:185:          await salutationService.updateOrCreate(\n./voice-synthsizer-job-handler/index.js:247:            await jobService.insertMany(jobsToInsert)\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_91","type":"command_execution","command":"/bin/bash -lc \"node - <<'NODE'\nconst mongoose = require('mongoose')\nif (typeof mongoose.isObjectIdOrHexString \"'!== '\"'function') process.exit(1)\nconsole.log(mongoose.isObjectIdOrHexString('507f1f77bcf86cd799439011'))\nconsole.log(mongoose.isObjectIdOrHexString(undefined))\nNODE\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_91","type":"command_execution","command":"/bin/bash -lc \"node - <<'NODE'\nconst mongoose = require('mongoose')\nif (typeof mongoose.isObjectIdOrHexString \"'!== '\"'function') process.exit(1)\nconsole.log(mongoose.isObjectIdOrHexString('507f1f77bcf86cd799439011'))\nconsole.log(mongoose.isObjectIdOrHexString(undefined))\nNODE\"","aggregated_output":"true\nfalse\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_92","type":"command_execution","command":"/bin/bash -lc 'npx prettier@2.8.8 --no-semi --single-quote --trailing-comma es5 --end-of-line lf --write voice-cloning-job-handler/index.js voice-synthsizer-job-handler/index.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_92","type":"command_execution","command":"/bin/bash -lc 'npx prettier@2.8.8 --no-semi --single-quote --trailing-comma es5 --end-of-line lf --write voice-cloning-job-handler/index.js voice-synthsizer-job-handler/index.js'","aggregated_output":"npx: installed 1 in 0.709s\nvoice-cloning-job-handler/index.js 111ms\nvoice-synthsizer-job-handler/index.js 39ms\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_93","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_93","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_94","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_94","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_95","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/index.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_95","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/index.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_96","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_96","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_97","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/index.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_97","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/index.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_98","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/job/job_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_99","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/salutation/salutation_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_98","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/job/job_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_99","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/salutation/salutation_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_100","type":"command_execution","command":"/bin/bash -lc 'git diff --check && git status --short'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_100","type":"command_execution","command":"/bin/bash -lc 'git diff --check && git status --short'","aggregated_output":" M voice-cloning-job-handler/index.js\n M voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n M voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n M voice-synthsizer-job-handler/index.js\n M voice-synthsizer-job-handler/job/job_service.js\n M voice-synthsizer-job-handler/salutation/salutation_service.js\n M voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_101","type":"command_execution","command":"/bin/bash -lc \"nl -ba voice-cloning-job-handler/index.js | sed -n '35,210p'; nl -ba voice-synthsizer-job-handler/index.js | sed -n '35,270p'; nl -ba voice-cloning-job-handler/voice_cloning/voice_cloning_service.js | sed -n '35,160p'; nl -ba voice-synthsizer-job-handler/salutation/salutation_service.js | sed -n '20,120p'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_101","type":"command_execution","command":"/bin/bash -lc \"nl -ba voice-cloning-job-handler/index.js | sed -n '35,210p'; nl -ba voice-synthsizer-job-handler/index.js | sed -n '35,270p'; nl -ba voice-cloning-job-handler/voice_cloning/voice_cloning_service.js | sed -n '35,160p'; nl -ba voice-synthsizer-job-handler/salutation/salutation_service.js | sed -n '20,120p'\"","aggregated_output":"    35\t  try {\n    36\t    await mongoose.connect(dbUri)\n    37\t    console.log('Connected to Mongo DB !')\n    38\t  } catch (error) {\n    39\t    console.log('Failed to connect dns mongo: ', error)\n    40\t    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n    41\t    throw error\n    42\t  }\n    43\t}\n    44\t\n    45\tclass RejectedJobError extends Error {\n    46\t  constructor(message) {\n    47\t    super(message)\n    48\t    this.name = 'RejectedJobError'\n    49\t  }\n    50\t}\n    51\t\n    52\tconst validateObjectId = (value, fieldName) => {\n    53\t  if (!mongoose.isObjectIdOrHexString(value)) {\n    54\t    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n    55\t  }\n    56\t}\n    57\t\n    58\tconst getJobContext = (job) => {\n    59\t  if (!job || !job._doc || typeof job._doc !== 'object') {\n    60\t    throw new RejectedJobError('Invalid voice cloning job payload')\n    61\t  }\n    62\t\n    63\t  const { metadata, input, _id, userAudioProfileId, userId } = job._doc\n    64\t\n    65\t  validateObjectId(_id, '_id')\n    66\t  validateObjectId(userAudioProfileId, 'userAudioProfileId')\n    67\t  validateObjectId(userId, 'userId')\n    68\t\n    69\t  return { metadata, input, _id, userAudioProfileId, userId, env: job.env }\n    70\t}\n    71\t\n    72\tfunction execShellCommand(cmd, logPath) {\n    73\t  // const exec = require(\"child_process\").exec;\n    74\t  return new Promise((resolve, reject) => {\n    75\t    exec(cmd, { maxBuffer: 1024 * 1000000 }, async (error, stdout, stderr) => {\n    76\t      if (error) {\n    77\t        console.log('Error while proccessing python command', error)\n    78\t        reject(error)\n    79\t      }\n    80\t      // console.log('Stdout --- ', stdout)\n    81\t      // console.log('Stderror --- ', stderr)\n    82\t      await fs.promises.writeFile(`${logPath}/error.log`, stderr)\n    83\t      await fs.promises.writeFile(`${logPath}/info.log`, stdout)\n    84\t\n    85\t      resolve()\n    86\t    })\n    87\t  })\n    88\t}\n    89\t\n    90\tasync function getFile(waveUrl, path) {\n    91\t  return new Promise((resolve) => {\n    92\t    https.get(waveUrl, (res) => {\n    93\t      const writeStream = fs.createWriteStream(path)\n    94\t\n    95\t      res.pipe(writeStream)\n    96\t\n    97\t      writeStream.on('finish', () => {\n    98\t        writeStream.close()\n    99\t        resolve()\n   100\t      })\n   101\t    })\n   102\t  })\n   103\t}\n   104\t\n   105\tfunction pad(s) {\n   106\t  while (s.length < 3) s = '0' + s // IN future we will need padding to 4\n   107\t  return s\n   108\t}\n   109\t\n   110\tconst processQueue = async () => {\n   111\t  let message\n   112\t  let messageDeleted = false\n   113\t\n   114\t  try {\n   115\t    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n   116\t\n   117\t    if (\n   118\t      typeof response.Messages !== 'undefined' &&\n   119\t      response.Messages.length > 0\n   120\t    ) {\n   121\t      throttleMessageFetching = false\n   122\t      message = response.Messages[0]\n   123\t\n   124\t      let job\n   125\t      try {\n   126\t        job = JSON.parse(message.Body)\n   127\t      } catch (error) {\n   128\t        throw new RejectedJobError('Invalid JSON in voice cloning job')\n   129\t      }\n   130\t\n   131\t      console.log('job===', job)\n   132\t\n   133\t      const { metadata, input, _id, userAudioProfileId, userId, env } =\n   134\t        getJobContext(job)\n   135\t      console.log('userAudioProfileId', userAudioProfileId)\n   136\t      console.log('_id', _id)\n   137\t      console.log('env', env)\n   138\t\n   139\t      console.log('metadata------', metadata)\n   140\t      console.log('input', input)\n   141\t      const DB_URI =\n   142\t        env === 'production'\n   143\t          ? mongoUriProd\n   144\t          : env === 'staging'\n   145\t          ? mongoUriStaging\n   146\t          : mongoUriDev\n   147\t\n   148\t      console.log('DB_URI ', DB_URI)\n   149\t      await connectDB(DB_URI)\n   150\t\n   151\t      const [voiceCloningJob, userAudioProfile] = await Promise.all([\n   152\t        voiceCloningService.read({\n   153\t          _id,\n   154\t          userId,\n   155\t          userAudioProfileId,\n   156\t        }),\n   157\t        userAudioProfileService.read({\n   158\t          _id: userAudioProfileId,\n   159\t          userId,\n   160\t        }),\n   161\t      ])\n   162\t\n   163\t      if (!voiceCloningJob || !userAudioProfile) {\n   164\t        throw new RejectedJobError(\n   165\t          'Voice cloning job does not belong to the supplied userId'\n   166\t        )\n   167\t      }\n   168\t\n   169\t      await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n   170\t      messageDeleted = true\n   171\t\n   172\t      const cloudFrontUrl =\n   173\t        env === 'production'\n   174\t          ? cloudFrontUrlProd\n   175\t          : env === 'staging'\n   176\t          ? cloudFrontUrlStaging\n   177\t          : cloudFrontUrlDev\n   178\t\n   179\t      try {\n   180\t        const { directoryName } = metadata\n   181\t        console.log('directoryName', directoryName)\n   182\t        const logPath = `/mnt/efs/potion-voice/${env}/${directoryName}`\n   183\t        if (!fs.existsSync(logPath)) {\n   184\t          fs.mkdirSync(logPath, { recursive: true })\n   185\t        }\n   186\t        // update the db model to processing\n   187\t        await voiceCloningService.update({ _id, status: 'processing' }, userId)\n   188\t        await userAudioProfileService.update(\n   189\t          {\n   190\t            _id: userAudioProfileId,\n   191\t            status: 'processing',\n   192\t          },\n   193\t          userId\n   194\t        )\n   195\t\n   196\t        // create directory for userid-useraudioprofileid if not exist\n   197\t        const rootPath = `/tmp/${directoryName}`\n   198\t        const wavePath = `${rootPath}/wav48/1`\n   199\t        if (!fs.existsSync(wavePath)) {\n   200\t          fs.mkdirSync(wavePath, { recursive: true })\n   201\t        }\n   202\t\n   203\t        const txtPath = `${rootPath}/txt/1`\n   204\t        if (!fs.existsSync(txtPath)) {\n   205\t          fs.mkdirSync(txtPath, { recursive: true })\n   206\t        }\n   207\t        // download the training data files and put it in respective directories\n   208\t        for (let index = 0; index < input.length; index++) {\n   209\t          const item = input[index]\n   210\t\n    35\t  })\n    36\t}\n    37\t\n    38\tasync function connectDB(dbUri, retryCount = 0) {\n    39\t  console.log('Connection Attempt : ', retryCount)\n    40\t  mongoose.set('strictQuery', true)\n    41\t\n    42\t  try {\n    43\t    await mongoose.connect(dbUri)\n    44\t    console.log('Connected to Mongo DB !')\n    45\t  } catch (error) {\n    46\t    console.log('Failed to connect dns mongo: ', error)\n    47\t    if (retryCount < 6) return connectDB(dbUri, retryCount + 1)\n    48\t    throw error\n    49\t  }\n    50\t}\n    51\t\n    52\tclass RejectedJobError extends Error {\n    53\t  constructor(message) {\n    54\t    super(message)\n    55\t    this.name = 'RejectedJobError'\n    56\t  }\n    57\t}\n    58\t\n    59\tconst validateObjectId = (value, fieldName) => {\n    60\t  if (!mongoose.isObjectIdOrHexString(value)) {\n    61\t    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n    62\t  }\n    63\t}\n    64\t\n    65\tconst validateJob = (job) => {\n    66\t  if (!job || typeof job !== 'object') {\n    67\t    throw new RejectedJobError('Invalid voice synthesizer job payload')\n    68\t  }\n    69\t\n    70\t  validateObjectId(job.userId, 'userId')\n    71\t  validateObjectId(job.userAudioProfileId, 'userAudioProfileId')\n    72\t  validateObjectId(job.salutationId, 'salutationId')\n    73\t  validateObjectId(job.recordingId, 'recordingId')\n    74\t}\n    75\t\n    76\tconst processQueue = async () => {\n    77\t  try {\n    78\t    const response = await sqs.fetchMessageFromSQS(sqsQueueUrl)\n    79\t\n    80\t    if (\n    81\t      typeof response.Messages !== 'undefined' &&\n    82\t      response.Messages.length > 0\n    83\t    ) {\n    84\t      throttleMessageFetching = false\n    85\t      const message = response.Messages[0]\n    86\t      await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n    87\t\n    88\t      let job\n    89\t      try {\n    90\t        job = JSON.parse(message.Body)\n    91\t      } catch (error) {\n    92\t        throw new RejectedJobError('Invalid JSON in voice synthesizer job')\n    93\t      }\n    94\t      validateJob(job)\n    95\t\n    96\t      try {\n    97\t        const {\n    98\t          userId,\n    99\t          userAudioProfileId,\n   100\t          text,\n   101\t          firstName,\n   102\t          salutationId,\n   103\t          recordingId,\n   104\t          baseUrlForPotionAi,\n   105\t          env,\n   106\t        } = job\n   107\t\n   108\t        const DB_URI =\n   109\t          env === 'production'\n   110\t            ? mongoUriProd\n   111\t            : env === 'staging'\n   112\t            ? mongoUriStaging\n   113\t            : mongoUriDev\n   114\t\n   115\t        console.log('DB_URI ', DB_URI)\n   116\t        await connectDB(DB_URI)\n   117\t\n   118\t        // read the path for the training model for the this users audio profile\n   119\t\n   120\t        const userAudioProfile = await userAudioProfileService.read({\n   121\t          _id: userAudioProfileId,\n   122\t          userId,\n   123\t          status: 'completed',\n   124\t        })\n   125\t        if (userAudioProfile) {\n   126\t          const { training_model_path } = userAudioProfile\n   127\t\n   128\t          const [salutationToUpdate, recordingToUpdate] = await Promise.all([\n   129\t            recordingSalutationModel.findOne({\n   130\t              _id: salutationId,\n   131\t              userId,\n   132\t              deleted: false,\n   133\t            }),\n   134\t            recordingModel.findOne({\n   135\t              _id: recordingId,\n   136\t              userId,\n   137\t              deleted: false,\n   138\t            }),\n   139\t          ])\n   140\t\n   141\t          if (!salutationToUpdate || !recordingToUpdate) {\n   142\t            throw new RejectedJobError(\n   143\t              'Recording data does not belong to the supplied userId'\n   144\t            )\n   145\t          }\n   146\t\n   147\t          const {\n   148\t            voice_model_light_path,\n   149\t            voice_model_config_light_path,\n   150\t            voice_model_speakers_file_path, // name for speakers embeddings file path\n   151\t          } = training_model_path\n   152\t\n   153\t          const outputPath = `/tmp/${uuid()}/`\n   154\t          if (!fs.existsSync(outputPath)) {\n   155\t            fs.mkdirSync(outputPath, { recursive: true })\n   156\t          }\n   157\t\n   158\t          const AI_COMMAND = `python3 ../voice-cloning/synthesize_speech.py --voice_model_path ${voice_model_light_path} --voice_model_config_path ${voice_model_config_light_path} --speaker_embeddings_path ${voice_model_speakers_file_path} --txt \"${text}\" --output_path ${outputPath}`\n   159\t          console.log('AI_COMMAND ', AI_COMMAND)\n   160\t\n   161\t          const SYNTHESIZE_AI_LABEL = `Time consumed by AI` + Math.random()\n   162\t          console.time(SYNTHESIZE_AI_LABEL)\n   163\t          const aiResponse = await execShellCommand(AI_COMMAND)\n   164\t          console.timeEnd(SYNTHESIZE_AI_LABEL)\n   165\t\n   166\t          let generatedFileName = ''\n   167\t          fs.readdirSync(`${outputPath}`).forEach((file) => {\n   168\t            if (file.includes('sr48000.wav')) generatedFileName = file\n   169\t          })\n   170\t\n   171\t          // upload the file to s3\n   172\t          const uploadParams = {\n   173\t            filePath: `${outputPath}${generatedFileName}`,\n   174\t            bucket: `recordings-${env}`,\n   175\t            fileName: `${uuid()}_salutation_${firstName.replace('-', '_')}.wav`,\n   176\t            contentType: 'audio/x-wav',\n   177\t            fileType: 'wav',\n   178\t          }\n   179\t          console.time('Time to Upload video on S3')\n   180\t          const greetingUploadResponse = await s3.upload(uploadParams)\n   181\t          console.timeEnd('Time to Upload video on S3')\n   182\t\n   183\t          // Create new entry with the s3 path to salutation collection for the user and its profile id\n   184\t          // upsert the salutation\n   185\t          await salutationService.updateOrCreate(\n   186\t            {\n   187\t              firstName: firstName,\n   188\t              salutationVideo: greetingUploadResponse,\n   189\t              userAudioProfileId,\n   190\t            },\n   191\t            userId\n   192\t          )\n   193\t          // update the dynamic recordings for the current dynamic video with salutation url\n   194\t          const jobsToInsert = []\n   195\t\n   196\t          const updatedRecordingSalutation =\n   197\t            await recordingSalutationModel.findOneAndUpdate(\n   198\t              {\n   199\t                _id: salutationId,\n   200\t                userId,\n   201\t                deleted: false,\n   202\t              },\n   203\t              {\n   204\t                $set: {\n   205\t                  salutationVideo: greetingUploadResponse,\n   206\t                },\n   207\t              },\n   208\t              { new: true }\n   209\t            )\n   210\t\n   211\t          if (!updatedRecordingSalutation) {\n   212\t            throw new RejectedJobError(\n   213\t              'Recording salutation is no longer available for this userId'\n   214\t            )\n   215\t          }\n   216\t\n   217\t          const jobData = {\n   218\t            originalGreeting: recordingToUpdate.masterSalutationVideoUrl,\n   219\t            originalVideo:\n   220\t              recordingToUpdate.originalVideoUrl ||\n   221\t              recordingToUpdate.urls[0].url,\n   222\t            cropTimestamp: recordingToUpdate.cropTimestamp,\n   223\t            greetingClips: [greetingUploadResponse],\n   224\t            greetingObjects: [\n   225\t              {\n   226\t                greetingId: salutationToUpdate._id,\n   227\t                firstName: firstName,\n   228\t                videoUrl: greetingUploadResponse,\n   229\t              },\n   230\t            ],\n   231\t            requestOrigin: baseUrlForPotionAi,\n   232\t            environment: env,\n   233\t            recordingId: recordingToUpdate._id,\n   234\t            salutation: salutationToUpdate._id,\n   235\t            dynamicVideoType: recordingToUpdate.dynamicVideoType,\n   236\t          }\n   237\t          jobsToInsert.push({\n   238\t            firstName,\n   239\t            recordingId: recordingToUpdate._id,\n   240\t            userId,\n   241\t            salutationId: salutationToUpdate._id,\n   242\t            metadata: jobData,\n   243\t          })\n   244\t\n   245\t          // create the job for the ai to create processing\n   246\t          if (jobsToInsert.length) {\n   247\t            await jobService.insertMany(jobsToInsert)\n   248\t          }\n   249\t\n   250\t          fs.unlinkSync(`${outputPath}${generatedFileName}`)\n   251\t          console.log(`[deleted] ${outputPath}${generatedFileName}`)\n   252\t        } else {\n   253\t          throw new RejectedJobError(\n   254\t            'Audio profile does not belong to the supplied userId or is not completed'\n   255\t          )\n   256\t        }\n   257\t      } catch (error) {\n   258\t        if (error instanceof RejectedJobError) {\n   259\t          console.warn('Rejected voice synthesizer job', {\n   260\t            reason: error.message,\n   261\t          })\n   262\t        } else {\n   263\t          console.error('Error while synthesizing audio', { error })\n   264\t          Bugsnag.notify(\n   265\t            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n   266\t          )\n   267\t          Bugsnag.notify(error)\n   268\t        }\n   269\t      }\n   270\t    } else {\n    35\t      'ERROR - VOICE CLONING SERVICE > insertMany',\n    36\t      StringifyUtils.potionErrorObj(error, details)\n    37\t    )\n    38\t    throw error\n    39\t  }\n    40\t}\n    41\t\n    42\tconst read =\n    43\t  (VoiceCloningModel) =>\n    44\t  async (filter = {}, userId) => {\n    45\t    try {\n    46\t      const tenantId = requireUserId(\n    47\t        userId || filter.userId,\n    48\t        'read a voice clone'\n    49\t      )\n    50\t      const foundModel = await VoiceCloningModel.findOne({\n    51\t        ...filter,\n    52\t        userId: tenantId,\n    53\t        deleted: false,\n    54\t      })\n    55\t      return foundModel\n    56\t    } catch (error) {\n    57\t      const details = { filter }\n    58\t      console.log(\n    59\t        'ERROR - VOICE CLONING SERVICE > read',\n    60\t        StringifyUtils.potionErrorObj(error, details)\n    61\t      )\n    62\t      throw error\n    63\t    }\n    64\t  }\n    65\t\n    66\tconst find =\n    67\t  (VoiceCloningModel) =>\n    68\t  async (filter = {}, userId) => {\n    69\t    try {\n    70\t      const tenantId = requireUserId(\n    71\t        userId || filter.userId,\n    72\t        'find voice clones'\n    73\t      )\n    74\t      const foundModels = await VoiceCloningModel.find({\n    75\t        ...filter,\n    76\t        userId: tenantId,\n    77\t        deleted: false,\n    78\t      })\n    79\t      return foundModels\n    80\t    } catch (error) {\n    81\t      const details = { filter }\n    82\t      console.log(\n    83\t        'ERROR - VOICE CLONING SERVICE > find',\n    84\t        StringifyUtils.potionErrorObj(error, details)\n    85\t      )\n    86\t      throw error\n    87\t    }\n    88\t  }\n    89\t\n    90\tconst update =\n    91\t  (VoiceCloningModel) =>\n    92\t  async (data = {}, userId) => {\n    93\t    try {\n    94\t      const tenantId = requireUserId(\n    95\t        userId || data.userId,\n    96\t        'update a voice clone'\n    97\t      )\n    98\t      const { _id, ...updates } = data\n    99\t      delete updates.userId\n   100\t\n   101\t      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n   102\t        { _id, userId: tenantId, deleted: false },\n   103\t        { $set: updates },\n   104\t        { new: true }\n   105\t      )\n   106\t      return updatedModel\n   107\t    } catch (error) {\n   108\t      const details = { data }\n   109\t      console.log(\n   110\t        'ERROR - VOICE CLONING SERVICE > update',\n   111\t        StringifyUtils.potionErrorObj(error, details)\n   112\t      )\n   113\t      throw error\n   114\t    }\n   115\t  }\n   116\t\n   117\tconst remove =\n   118\t  (VoiceCloningModel) =>\n   119\t  async (filter = {}, userId) => {\n   120\t    try {\n   121\t      const tenantId = requireUserId(\n   122\t        userId || filter.userId,\n   123\t        'remove a voice clone'\n   124\t      )\n   125\t      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\n   126\t        { ...filter, userId: tenantId },\n   127\t        { $set: { deleted: true } },\n   128\t        { new: true }\n   129\t      )\n   130\t      return updatedModel\n   131\t    } catch (error) {\n   132\t      const details = { filter }\n   133\t      console.log(\n   134\t        'ERROR - VOICE CLONING SERVICE > remove',\n   135\t        StringifyUtils.potionErrorObj(error, details)\n   136\t      )\n   137\t      throw error\n   138\t    }\n   139\t  }\n   140\t\n   141\tconst removeMany =\n   142\t  (VoiceCloningModel) =>\n   143\t  async (filter = {}, userId) => {\n   144\t    try {\n   145\t      const tenantId = requireUserId(\n   146\t        userId || filter.userId,\n   147\t        'remove voice clones'\n   148\t      )\n   149\t      const updatedModel = await VoiceCloningModel.updateMany(\n   150\t        { ...filter, userId: tenantId },\n   151\t        { $set: { deleted: true } }\n   152\t      )\n   153\t      return updatedModel\n   154\t    } catch (error) {\n   155\t      const details = { filter }\n   156\t      console.log(\n   157\t        'ERROR - VOICE CLONING SERVICE > removeMany',\n   158\t        StringifyUtils.potionErrorObj(error, details)\n   159\t      )\n   160\t      throw error\n    20\t  const savedSalutation = await newSalutation.save()\n    21\t  return savedSalutation\n    22\t}\n    23\t\n    24\tconst read =\n    25\t  (Salutation) =>\n    26\t  async (filter = {}, userId) => {\n    27\t    const tenantId = requireUserId(userId || filter.userId, 'read a salutation')\n    28\t    const foundSalutation = await Salutation.findOne({\n    29\t      ...filter,\n    30\t      userId: tenantId,\n    31\t      deleted: false,\n    32\t    })\n    33\t    return foundSalutation\n    34\t  }\n    35\t\n    36\tconst find =\n    37\t  (Salutation) =>\n    38\t  async (filter = {}, userId) => {\n    39\t    const tenantId = requireUserId(userId || filter.userId, 'find salutations')\n    40\t    const foundSalutations = await Salutation.find({\n    41\t      ...filter,\n    42\t      userId: tenantId,\n    43\t      deleted: false,\n    44\t    })\n    45\t    return foundSalutations\n    46\t  }\n    47\t\n    48\tconst update = (Salutation) => async (salutation, userId) => {\n    49\t  const tenantId = requireUserId(userId, 'update a salutation')\n    50\t  const updatedSalutation = await Salutation.findOneAndUpdate(\n    51\t    { _id: salutation._id, userId: tenantId, deleted: false },\n    52\t    { $set: getUpdates(salutation) },\n    53\t    { new: true }\n    54\t  )\n    55\t  return updatedSalutation\n    56\t}\n    57\t\n    58\tconst modify =\n    59\t  (Salutation) =>\n    60\t  async (salutation = {}, userId) => {\n    61\t    const tenantId = requireUserId(\n    62\t      userId || salutation.userId,\n    63\t      'modify a salutation'\n    64\t    )\n    65\t    const findQuery = salutation._id\n    66\t      ? { _id: salutation._id, userId: tenantId, deleted: false }\n    67\t      : {\n    68\t          transcriptId: salutation.transcriptId,\n    69\t          userId: tenantId,\n    70\t          deleted: false,\n    71\t        }\n    72\t\n    73\t    const updatedSalutation = await Salutation.findOneAndUpdate(\n    74\t      findQuery,\n    75\t      { $set: getUpdates(salutation) },\n    76\t      { new: true }\n    77\t    )\n    78\t    return updatedSalutation\n    79\t  }\n    80\t\n    81\tconst updateOrCreate =\n    82\t  (Salutation) =>\n    83\t  async ({ firstName, salutationVideo, userAudioProfileId }, userId) => {\n    84\t    const tenantId = requireUserId(userId, 'upsert a salutation')\n    85\t    const salutation = await read(Salutation)(\n    86\t      { firstName, userAudioProfileId },\n    87\t      tenantId\n    88\t    )\n    89\t\n    90\t    if (salutation) {\n    91\t      salutation.salutationVideo = salutationVideo\n    92\t      return update(Salutation)(salutation, tenantId)\n    93\t    }\n    94\t\n    95\t    return create(Salutation)(\n    96\t      { firstName, salutationVideo, userAudioProfileId },\n    97\t      tenantId\n    98\t    )\n    99\t  }\n   100\t\n   101\tconst remove =\n   102\t  (Salutation) =>\n   103\t  async (filter = {}, userId) => {\n   104\t    const tenantId = requireUserId(\n   105\t      userId || filter.userId,\n   106\t      'remove a salutation'\n   107\t    )\n   108\t    const updatedSalutation = await Salutation.findOneAndUpdate(\n   109\t      { ...filter, userId: tenantId, deleted: false },\n   110\t      { $set: { deleted: true } },\n   111\t      { new: true }\n   112\t    )\n   113\t    return updatedSalutation\n   114\t  }\n   115\t\n   116\tmodule.exports = (Salutation) => ({\n   117\t  create: create(Salutation),\n   118\t  read: read(Salutation),\n   119\t  remove: remove(Salutation),\n   120\t  update: update(Salutation),\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_102","type":"command_execution","command":"/bin/bash -lc \"node -e \\\"const p=require('./voice-synthsizer-job-handler/package-lock.json'); console.log((p.packages&&p.packages['node_modules/mongoose']&&p.packages['node_modules/mongoose'].version)||'legacy-lock')\\\" && rg -n '\\\"mongoose\\\"|\\\"version\\\": \\\"6\\\\.' voice-synthsizer-job-handler/package-lock.json | head -20\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_102","type":"command_execution","command":"/bin/bash -lc \"node -e \\\"const p=require('./voice-synthsizer-job-handler/package-lock.json'); console.log((p.packages&&p.packages['node_modules/mongoose']&&p.packages['node_modules/mongoose'].version)||'legacy-lock')\\\" && rg -n '\\\"mongoose\\\"|\\\"version\\\": \\\"6\\\\.' voice-synthsizer-job-handler/package-lock.json | head -20\"","aggregated_output":"legacy-lock\n55:      \"version\": \"6.0.0\",\n65:      \"version\": \"6.1.1\",\n285:      \"version\": \"6.1.0\",\n333:    \"mongoose\": {\n334:      \"version\": \"6.3.1\",\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_103","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_103","type":"file_change","changes":[{"path":"/workspace/voice-cloning-job-handler/index.js","kind":"update"},{"path":"/workspace/voice-synthsizer-job-handler/index.js","kind":"update"}],"status":"completed"}}
{"type":"item.started","item":{"id":"item_104","type":"command_execution","command":"/bin/bash -lc \"sed -n '48,58p' voice-cloning-job-handler/index.js && sed -n '56,66p' voice-synthsizer-job-handler/index.js\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_104","type":"command_execution","command":"/bin/bash -lc \"sed -n '48,58p' voice-cloning-job-handler/index.js && sed -n '56,66p' voice-synthsizer-job-handler/index.js\"","aggregated_output":"    this.name = 'RejectedJobError'\n  }\n}\n\nconst validateObjectId = (value, fieldName) => {\n  if (typeof value !== 'string' || !/^[a-f\\d]{24}$/i.test(value)) {\n    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n  }\n}\n\nconst getJobContext = (job) => {\n  }\n}\n\nconst validateObjectId = (value, fieldName) => {\n  if (typeof value !== 'string' || !/^[a-f\\d]{24}$/i.test(value)) {\n    throw new RejectedJobError(`Invalid or missing ${fieldName}`)\n  }\n}\n\nconst validateJob = (job) => {\n  if (!job || typeof job !== 'object') {\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_105","type":"command_execution","command":"/bin/bash -lc \"node - <<'NODE'\nconst mongoose = require('mongoose')\nconst Model = mongoose.model('QueueShapeCheck', new mongoose.Schema({ userId: mongoose.Schema.Types.ObjectId }))\nconst doc = new Model({ userId: new mongoose.Types.ObjectId() })\nconst payload = JSON.parse(JSON.stringify({ ...doc, env: 'test' }))\nconsole.log(typeof payload._doc.userId, payload._doc.userId)\nNODE\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_105","type":"command_execution","command":"/bin/bash -lc \"node - <<'NODE'\nconst mongoose = require('mongoose')\nconst Model = mongoose.model('QueueShapeCheck', new mongoose.Schema({ userId: mongoose.Schema.Types.ObjectId }))\nconst doc = new Model({ userId: new mongoose.Types.ObjectId() })\nconst payload = JSON.parse(JSON.stringify({ ...doc, env: 'test' }))\nconsole.log(typeof payload._doc.userId, payload._doc.userId)\nNODE\"","aggregated_output":"string 6acfc7369717b5e1cd12ce61\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_106","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/index.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_107","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_106","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/index.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_107","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/voice_cloning/voice_cloning_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_108","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_109","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/index.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_108","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_109","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/index.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_110","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_111","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/job/job_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_112","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/salutation/salutation_service.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_110","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_111","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/job/job_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_112","type":"command_execution","command":"/bin/bash -lc \"node --check 'voice-synthsizer-job-handler/salutation/salutation_service.js'\"","aggregated_output":"","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_113","type":"command_execution","command":"/bin/bash -lc \"git diff --check && rg -n \\\"findOne\\\\(\\\\{[[:space:]]*\"'$|findOneAndUpdate'\"\\\\([[:space:]]*\"'$|updateMany'\"\\\\([[:space:]]*\"'$\" voice-cloning-job-handler voice-synthsizer-job-handler -g '\"'*.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_113","type":"command_execution","command":"/bin/bash -lc \"git diff --check && rg -n \\\"findOne\\\\(\\\\{[[:space:]]*\"'$|findOneAndUpdate'\"\\\\([[:space:]]*\"'$|updateMany'\"\\\\([[:space:]]*\"'$\" voice-cloning-job-handler voice-synthsizer-job-handler -g '\"'*.js'\"","aggregated_output":"voice-synthsizer-job-handler/salutation/salutation_service.js:28:    const foundSalutation = await Salutation.findOne({\nvoice-synthsizer-job-handler/salutation/salutation_service.js:50:  const updatedSalutation = await Salutation.findOneAndUpdate(\nvoice-synthsizer-job-handler/salutation/salutation_service.js:73:    const updatedSalutation = await Salutation.findOneAndUpdate(\nvoice-synthsizer-job-handler/salutation/salutation_service.js:108:    const updatedSalutation = await Salutation.findOneAndUpdate(\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:50:      const foundModel = await VoiceCloningModel.findOne({\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:101:      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:125:      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:149:      const updatedModel = await VoiceCloningModel.updateMany(\nvoice-synthsizer-job-handler/index.js:129:            recordingSalutationModel.findOne({\nvoice-synthsizer-job-handler/index.js:134:            recordingModel.findOne({\nvoice-synthsizer-job-handler/index.js:197:            await recordingSalutationModel.findOneAndUpdate(\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:50:      const foundModel = await UserAudioProfileModel.findOne({\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:101:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:125:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:149:      const updatedModel = await UserAudioProfileModel.updateMany(\nvoice-synthsizer-job-handler/job/job_service.js:43:      const foundJob = await Job.findOne({\nvoice-synthsizer-job-handler/job/job_service.js:89:      const updatedJob = await Job.findOneAndUpdate(\nvoice-synthsizer-job-handler/job/job_service.js:113:      const updatedJob = await Job.findOneAndUpdate(\nvoice-synthsizer-job-handler/job/job_service.js:139:      const updatedJob = await Job.updateMany(\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:50:      const foundModel = await UserAudioProfileModel.findOne({\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:101:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:125:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:149:      const updatedModel = await UserAudioProfileModel.updateMany(\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_114","type":"agent_message","text":"The query audit is clean: every Mongo read/update/delete in both worker packages now has an explicit tenant predicate, and create/batch-create helpers reject records without `userId`. I’m doing the final mocked cross-tenant override test and repository diff review."}}
{"type":"item.started","item":{"id":"item_115","type":"command_execution","command":"/bin/bash -lc \"node <<'NODE'\nconst assert = require('assert')\n\nasync function verifyCrud(factoryPath) {\n  const calls = {}\n  function Model() {}\n  Model.findOne = async (filter) => { calls.read = filter; return {} }\n  Model.find = async (filter) => { calls.find = filter; return [] }\n  Model.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  Model.updateMany = async (...args) => { calls.updateMany = args; return {} }\n  Model.insertMany = async (items) => { calls.insertMany = items; return items }\n  const service = require(factoryPath)(Model)\n\n  await service.read({ _id: 'document', userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await service.find({ userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.find.userId, 'tenant')\n  await service.update(\n    { _id: 'document', userId: 'wrong-tenant', status: 'done' },\n    'tenant'\n  )\n  assert.deepStrictEqual(calls.update[0], {\n    _id: 'document',\n    userId: 'tenant',\n    deleted: false,\n  })\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n  await service.remove({ _id: '\"'document', userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n}\n\nasync function main() {\n  await verifyCrud('./voice-cloning-job-handler/voice_cloning/voice_cloning_service')\n  await verifyCrud('./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service')\n  await verifyCrud('./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service')\n  await verifyCrud('./voice-synthsizer-job-handler/job/job_service')\n\n  const calls = {}\n  function Salutation() {}\n  Salutation.findOne = async (filter) => { calls.read = filter; return null }\n  Salutation.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  const service = require('./voice-synthsizer-job-handler/salutation/salutation_service')(Salutation)\n  await service.read({ _id: 'document', userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await service.modify(\n    { _id: 'document', userId: 'wrong-tenant', firstName: 'A' },\n    'tenant'\n  )\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n\n  process.stdout.write('\"'tenant isolation mock checks passed\\\\n')\n}\n\nmain().catch((error) => {\n  console.error(error)\n  process.exitCode = 1\n})\nNODE\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_115","type":"command_execution","command":"/bin/bash -lc \"node <<'NODE'\nconst assert = require('assert')\n\nasync function verifyCrud(factoryPath) {\n  const calls = {}\n  function Model() {}\n  Model.findOne = async (filter) => { calls.read = filter; return {} }\n  Model.find = async (filter) => { calls.find = filter; return [] }\n  Model.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  Model.updateMany = async (...args) => { calls.updateMany = args; return {} }\n  Model.insertMany = async (items) => { calls.insertMany = items; return items }\n  const service = require(factoryPath)(Model)\n\n  await service.read({ _id: 'document', userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await service.find({ userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.find.userId, 'tenant')\n  await service.update(\n    { _id: 'document', userId: 'wrong-tenant', status: 'done' },\n    'tenant'\n  )\n  assert.deepStrictEqual(calls.update[0], {\n    _id: 'document',\n    userId: 'tenant',\n    deleted: false,\n  })\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n  await service.remove({ _id: '\"'document', userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n}\n\nasync function main() {\n  await verifyCrud('./voice-cloning-job-handler/voice_cloning/voice_cloning_service')\n  await verifyCrud('./voice-cloning-job-handler/user_audio_profile/user_audio_profile_service')\n  await verifyCrud('./voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service')\n  await verifyCrud('./voice-synthsizer-job-handler/job/job_service')\n\n  const calls = {}\n  function Salutation() {}\n  Salutation.findOne = async (filter) => { calls.read = filter; return null }\n  Salutation.findOneAndUpdate = async (...args) => { calls.update = args; return {} }\n  const service = require('./voice-synthsizer-job-handler/salutation/salutation_service')(Salutation)\n  await service.read({ _id: 'document', userId: 'wrong-tenant' }, 'tenant')\n  assert.strictEqual(calls.read.userId, 'tenant')\n  await service.modify(\n    { _id: 'document', userId: 'wrong-tenant', firstName: 'A' },\n    'tenant'\n  )\n  assert.strictEqual(calls.update[0].userId, 'tenant')\n  assert.strictEqual(calls.update[1].\"'$set.userId, undefined)\n\n  process.stdout.write('\"'tenant isolation mock checks passed\\\\n')\n}\n\nmain().catch((error) => {\n  console.error(error)\n  process.exitCode = 1\n})\nNODE\"","aggregated_output":"tenant isolation mock checks passed\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_116","type":"command_execution","command":"/bin/bash -lc 'tail -55 index.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_116","type":"command_execution","command":"/bin/bash -lc 'tail -55 index.js'","aggregated_output":"      }\n    } else {\n      throttleMessageFetching = true\n    }\n  } catch (error) {\n    if (error instanceof RejectedJobError) {\n      if (message && !messageDeleted) {\n        try {\n          await sqs.deleteMessageFromSQS(sqsQueueUrl, message.ReceiptHandle)\n        } catch (deleteError) {\n          console.error('Unable to delete rejected voice cloning job', {\n            error: deleteError,\n          })\n          Bugsnag.notify(deleteError)\n        }\n      }\n      console.warn('Rejected voice cloning job', { reason: error.message })\n    } else {\n      console.error('Error while training voice clone', { error })\n      Bugsnag.notify(error)\n    }\n  } finally {\n    try {\n      await mongoose.connection.close()\n    } catch (error) {\n      console.error('Error while closing Mongo DB connection', { error })\n      Bugsnag.notify(error)\n    }\n  }\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  console.log('potion Voice Clone Process Started')\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n\n  while (true) {\n    try {\n      await processQueue()\n    } catch (error) {\n      console.error('Unexpected voice cloning worker error', { error })\n      Bugsnag.notify(error)\n    }\n    if (throttleMessageFetching) await sleep(2000)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_117","type":"command_execution","command":"/bin/bash -lc 'tail -55 index.js'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_117","type":"command_execution","command":"/bin/bash -lc 'tail -55 index.js'","aggregated_output":"          console.warn('Rejected voice synthesizer job', {\n            reason: error.message,\n          })\n        } else {\n          console.error('Error while synthesizing audio', { error })\n          Bugsnag.notify(\n            new Error(`Unable to synthesize audio ` + JSON.stringify(job))\n          )\n          Bugsnag.notify(error)\n        }\n      }\n    } else {\n      throttleMessageFetching = true\n    }\n  } catch (error) {\n    if (error instanceof RejectedJobError) {\n      console.warn('Rejected voice synthesizer job', {\n        reason: error.message,\n      })\n    } else {\n      console.error('Error while synthesizing audio', { error })\n      Bugsnag.notify(error)\n    }\n  } finally {\n    try {\n      await mongoose.connection.close()\n    } catch (error) {\n      console.error('Error while closing Mongo DB connection', { error })\n      Bugsnag.notify(error)\n    }\n  }\n}\n\nfunction sleep(ms) {\n  return new Promise((resolve) => {\n    setTimeout(resolve, ms)\n  })\n}\nconst init = async () => {\n  Bugsnag.start({\n    appVersion: APP_ENV + version,\n    apiKey: process.env.BUGSNAG_BACKEND_KEY,\n    releaseStage: process.env.NODE_ENV,\n  })\n  while (true) {\n    try {\n      await processQueue()\n    } catch (error) {\n      console.error('Unexpected voice synthesizer worker error', { error })\n      Bugsnag.notify(error)\n    }\n    if (throttleMessageFetching) await sleep(2000)\n  }\n}\ninit()\n","exit_code":0,"status":"completed"}}
{"type":"item.started","item":{"id":"item_118","type":"command_execution","command":"/bin/bash -lc 'git diff --check && git diff --stat && git status --short'","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.started","item":{"id":"item_119","type":"command_execution","command":"/bin/bash -lc \"rg -n -U \\\"(findOne|find|findOneAndUpdate|updateMany)\\\\([\"'^'\"\\\\)]*\\\\)\\\" voice-cloning-job-handler voice-synthsizer-job-handler -g '*.js'\"","aggregated_output":"","exit_code":null,"status":"in_progress"}}
{"type":"item.completed","item":{"id":"item_118","type":"command_execution","command":"/bin/bash -lc 'git diff --check && git diff --stat && git status --short'","aggregated_output":" voice-cloning-job-handler/index.js                 | 518 ++++++++++++---------\n .../user_audio_profile_service.js                  | 230 +++++----\n .../voice_cloning/voice_cloning_service.js         | 229 +++++----\n voice-synthsizer-job-handler/index.js              | 398 +++++++++-------\n voice-synthsizer-job-handler/job/job_service.js    | 197 ++++----\n .../salutation/salutation_service.js               | 211 +++++----\n .../user_audio_profile_service.js                  | 232 +++++----\n 7 files changed, 1151 insertions(+), 864 deletions(-)\n M voice-cloning-job-handler/index.js\n M voice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js\n M voice-cloning-job-handler/voice_cloning/voice_cloning_service.js\n M voice-synthsizer-job-handler/index.js\n M voice-synthsizer-job-handler/job/job_service.js\n M voice-synthsizer-job-handler/salutation/salutation_service.js\n M voice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_119","type":"command_execution","command":"/bin/bash -lc \"rg -n -U \\\"(findOne|find|findOneAndUpdate|updateMany)\\\\([\"'^'\"\\\\)]*\\\\)\\\" voice-cloning-job-handler voice-synthsizer-job-handler -g '*.js'\"","aggregated_output":"voice-synthsizer-job-handler/salutation/salutation_service.js:28:    const foundSalutation = await Salutation.findOne({\nvoice-synthsizer-job-handler/salutation/salutation_service.js:29:      ...filter,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:30:      userId: tenantId,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:31:      deleted: false,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:32:    })\nvoice-synthsizer-job-handler/salutation/salutation_service.js:40:    const foundSalutations = await Salutation.find({\nvoice-synthsizer-job-handler/salutation/salutation_service.js:41:      ...filter,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:42:      userId: tenantId,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:43:      deleted: false,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:44:    })\nvoice-synthsizer-job-handler/salutation/salutation_service.js:50:  const updatedSalutation = await Salutation.findOneAndUpdate(\nvoice-synthsizer-job-handler/salutation/salutation_service.js:51:    { _id: salutation._id, userId: tenantId, deleted: false },\nvoice-synthsizer-job-handler/salutation/salutation_service.js:52:    { $set: getUpdates(salutation) },\nvoice-synthsizer-job-handler/salutation/salutation_service.js:73:    const updatedSalutation = await Salutation.findOneAndUpdate(\nvoice-synthsizer-job-handler/salutation/salutation_service.js:74:      findQuery,\nvoice-synthsizer-job-handler/salutation/salutation_service.js:75:      { $set: getUpdates(salutation) },\nvoice-synthsizer-job-handler/salutation/salutation_service.js:108:    const updatedSalutation = await Salutation.findOneAndUpdate(\nvoice-synthsizer-job-handler/salutation/salutation_service.js:109:      { ...filter, userId: tenantId, deleted: false },\nvoice-synthsizer-job-handler/salutation/salutation_service.js:110:      { $set: { deleted: true } },\nvoice-synthsizer-job-handler/salutation/salutation_service.js:111:      { new: true }\nvoice-synthsizer-job-handler/salutation/salutation_service.js:112:    )\nvoice-synthsizer-job-handler/salutation/salutation_service.js:122:  find: find(Salutation),\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:50:      const foundModel = await VoiceCloningModel.findOne({\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:51:        ...filter,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:52:        userId: tenantId,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:53:        deleted: false,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:54:      })\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:74:      const foundModels = await VoiceCloningModel.find({\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:75:        ...filter,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:76:        userId: tenantId,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:77:        deleted: false,\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:78:      })\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:101:      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:102:        { _id, userId: tenantId, deleted: false },\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:103:        { $set: updates },\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:104:        { new: true }\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:105:      )\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:125:      const updatedModel = await VoiceCloningModel.findOneAndUpdate(\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:126:        { ...filter, userId: tenantId },\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:127:        { $set: { deleted: true } },\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:128:        { new: true }\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:129:      )\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:149:      const updatedModel = await VoiceCloningModel.updateMany(\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:150:        { ...filter, userId: tenantId },\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:151:        { $set: { deleted: true } }\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:152:      )\nvoice-cloning-job-handler/voice_cloning/voice_cloning_service.js:171:  find: find(VoiceCloningModel),\nvoice-synthsizer-job-handler/index.js:129:            recordingSalutationModel.findOne({\nvoice-synthsizer-job-handler/index.js:130:              _id: salutationId,\nvoice-synthsizer-job-handler/index.js:131:              userId,\nvoice-synthsizer-job-handler/index.js:132:              deleted: false,\nvoice-synthsizer-job-handler/index.js:133:            }),\nvoice-synthsizer-job-handler/index.js:134:            recordingModel.findOne({\nvoice-synthsizer-job-handler/index.js:135:              _id: recordingId,\nvoice-synthsizer-job-handler/index.js:136:              userId,\nvoice-synthsizer-job-handler/index.js:137:              deleted: false,\nvoice-synthsizer-job-handler/index.js:138:            }),\nvoice-synthsizer-job-handler/index.js:197:            await recordingSalutationModel.findOneAndUpdate(\nvoice-synthsizer-job-handler/index.js:198:              {\nvoice-synthsizer-job-handler/index.js:199:                _id: salutationId,\nvoice-synthsizer-job-handler/index.js:200:                userId,\nvoice-synthsizer-job-handler/index.js:201:                deleted: false,\nvoice-synthsizer-job-handler/index.js:202:              },\nvoice-synthsizer-job-handler/index.js:203:              {\nvoice-synthsizer-job-handler/index.js:204:                $set: {\nvoice-synthsizer-job-handler/index.js:205:                  salutationVideo: greetingUploadResponse,\nvoice-synthsizer-job-handler/index.js:206:                },\nvoice-synthsizer-job-handler/index.js:207:              },\nvoice-synthsizer-job-handler/index.js:208:              { new: true }\nvoice-synthsizer-job-handler/index.js:209:            )\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:50:      const foundModel = await UserAudioProfileModel.findOne({\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:51:        ...filter,\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:52:        userId: tenantId,\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:53:        deleted: false,\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:54:      })\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:74:      const foundModels = await UserAudioProfileModel.find({\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:75:        ...filter,\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:76:        userId: tenantId,\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:77:        deleted: false,\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:78:      })\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:101:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:102:        { _id, userId: tenantId, deleted: false },\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:103:        { $set: updates },\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:104:        { new: true }\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:105:      )\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:125:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:126:        { ...filter, userId: tenantId },\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:127:        { $set: { deleted: true } },\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:128:        { new: true }\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:129:      )\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:149:      const updatedModel = await UserAudioProfileModel.updateMany(\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:150:        { ...filter, userId: tenantId },\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:151:        { $set: { deleted: true } }\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:152:      )\nvoice-cloning-job-handler/user_audio_profile/user_audio_profile_service.js:171:  find: find(UserAudioProfileModel),\nvoice-synthsizer-job-handler/job/job_service.js:43:      const foundJob = await Job.findOne({\nvoice-synthsizer-job-handler/job/job_service.js:44:        ...filter,\nvoice-synthsizer-job-handler/job/job_service.js:45:        userId,\nvoice-synthsizer-job-handler/job/job_service.js:46:        deleted: false,\nvoice-synthsizer-job-handler/job/job_service.js:47:      })\nvoice-synthsizer-job-handler/job/job_service.js:65:      const foundJobs = await Job.find({\nvoice-synthsizer-job-handler/job/job_service.js:66:        ...filter,\nvoice-synthsizer-job-handler/job/job_service.js:67:        userId,\nvoice-synthsizer-job-handler/job/job_service.js:68:        deleted: false,\nvoice-synthsizer-job-handler/job/job_service.js:69:      })\nvoice-synthsizer-job-handler/job/job_service.js:89:      const updatedJob = await Job.findOneAndUpdate(\nvoice-synthsizer-job-handler/job/job_service.js:90:        { _id, userId, deleted: false },\nvoice-synthsizer-job-handler/job/job_service.js:91:        { $set: updates },\nvoice-synthsizer-job-handler/job/job_service.js:92:        {\nvoice-synthsizer-job-handler/job/job_service.js:93:          new: true,\nvoice-synthsizer-job-handler/job/job_service.js:94:        }\nvoice-synthsizer-job-handler/job/job_service.js:95:      )\nvoice-synthsizer-job-handler/job/job_service.js:113:      const updatedJob = await Job.findOneAndUpdate(\nvoice-synthsizer-job-handler/job/job_service.js:114:        { ...filter, userId },\nvoice-synthsizer-job-handler/job/job_service.js:115:        {\nvoice-synthsizer-job-handler/job/job_service.js:116:          $set: {\nvoice-synthsizer-job-handler/job/job_service.js:117:            deleted: true,\nvoice-synthsizer-job-handler/job/job_service.js:118:          },\nvoice-synthsizer-job-handler/job/job_service.js:119:        },\nvoice-synthsizer-job-handler/job/job_service.js:120:        { new: true }\nvoice-synthsizer-job-handler/job/job_service.js:121:      )\nvoice-synthsizer-job-handler/job/job_service.js:139:      const updatedJob = await Job.updateMany(\nvoice-synthsizer-job-handler/job/job_service.js:140:        { ...filter, userId },\nvoice-synthsizer-job-handler/job/job_service.js:141:        {\nvoice-synthsizer-job-handler/job/job_service.js:142:          $set: {\nvoice-synthsizer-job-handler/job/job_service.js:143:            deleted: true,\nvoice-synthsizer-job-handler/job/job_service.js:144:          },\nvoice-synthsizer-job-handler/job/job_service.js:145:        },\nvoice-synthsizer-job-handler/job/job_service.js:146:        { new: true }\nvoice-synthsizer-job-handler/job/job_service.js:147:      )\nvoice-synthsizer-job-handler/job/job_service.js:167:    find: find(Job),\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:50:      const foundModel = await UserAudioProfileModel.findOne({\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:51:        ...filter,\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:52:        userId: tenantId,\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:53:        deleted: false,\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:54:      })\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:74:      const foundModels = await UserAudioProfileModel.find({\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:75:        ...filter,\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:76:        userId: tenantId,\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:77:        deleted: false,\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:78:      })\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:101:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:102:        { _id, userId: tenantId, deleted: false },\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:103:        { $set: updates },\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:104:        { new: true }\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:105:      )\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:125:      const updatedModel = await UserAudioProfileModel.findOneAndUpdate(\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:126:        { ...filter, userId: tenantId },\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:127:        { $set: { deleted: true } },\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:128:        { new: true }\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:129:      )\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:149:      const updatedModel = await UserAudioProfileModel.updateMany(\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:150:        { ...filter, userId: tenantId },\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:151:        { $set: { deleted: true } }\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:152:      )\nvoice-synthsizer-job-handler/user_audio_profile/user_audio_profile_service.js:171:  find: find(UserAudioProfileModel),\n","exit_code":0,"status":"completed"}}
{"type":"item.completed","item":{"id":"item_120","type":"agent_message","text":"Implemented tenant isolation across both workers.\n\n- All MongoDB reads/writes now include `userId`.\n- Referenced records are ownership-validated before processing.\n- Update helpers prevent tenant ownership changes.\n- Invalid/unauthorized jobs are rejected safely without stopping polling.\n- Database retry/cleanup handling was hardened.\n\nKey changes: [cloning worker](/workspace/voice-cloning-job-handler/index.js:110), [synthesis worker](/workspace/voice-synthsizer-job-handler/index.js:76).\n\nValidation passed: syntax checks, diff checks, and mocked cross-tenant query tests.\n\nImportant: synthesis queue messages must now include top-level `userId`; legacy messages without it are rejected."}}
{"type":"turn.completed","usage":{"input_tokens":5523131,"cached_input_tokens":5385880,"cache_write_input_tokens":137044,"output_tokens":48537,"reasoning_output_tokens":22478}}
