{"record":{"id":"6524c77a9caa9b71","repo":"paperclipai/paperclip","slug":"migration-safety-check-found-findings-length-ne","errorCode":null,"errorMessage":"Migration safety check found ${findings.length} new finding(s).","messagePattern":"Migration safety check found (.+?) new finding\\(s\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/db/src/check-migration-safety.ts","lineNumber":1033,"sourceCode":"  ].join(\"\\n\");\n}\n\nfunction formatNewFindings(findings: readonly MigrationSafetyFinding[]): string {\n  const rendered = findings.map(formatFinding).join(\"\\n\\n\");\n  return [\n    `Migration safety check found ${findings.length} new finding(s).`,\n    \"Add a same-migration support index, use CONCURRENTLY where applicable, or add\",\n    \"`-- paperclip:migration-safety-ignore <rule>: <reason>` next to the statement.\",\n    \"\",\n    rendered,\n  ].join(\"\\n\");\n}\n\nasync function main() {\n  const result = analyzeMigrationSafety(await readMigrations());\n\n  if (result.newFindings.length > 0) {\n    throw new Error(formatNewFindings(result.newFindings));\n  }\n\n  const staleSuffix = result.staleBaselineIds.length > 0\n    ? ` (${result.staleBaselineIds.length} stale baseline id(s) ignored)`\n    : \"\";\n  console.log(\n    `Migration safety check passed: ${result.baselineFindings.length} historical finding(s) covered by baseline${staleSuffix}.`,\n  );\n}\n\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n  try {\n    await main();\n  } catch (error) {\n    const detail = error instanceof Error ? error.message : String(error);\n    console.error(`${basename(process.argv[1])}: ${detail}`);\n    process.exitCode = 1;\n  }","sourceCodeStart":1015,"sourceCodeEnd":1051,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/db/src/check-migration-safety.ts#L1015-L1051","documentation":"Error \"Migration safety check found ${findings.length} new finding(s).\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/db/src/check-migration-safety.ts:1033 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review and resolve the listed migration safety findings before committing.","Adjust the migration to avoid the flagged unsafe operations."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}