{"record":{"id":"eef827aaac39c4e5","repo":"paperclipai/paperclip","slug":"label-entry-does-not-start-with-a-4-digit-migra","errorCode":null,"errorMessage":"${label} entry does not start with a 4-digit migration number: ${value}","messagePattern":"(.+?) entry does not start with a 4-digit migration number: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/db/src/check-migration-numbering.ts","lineNumber":25,"sourceCode":"type JournalFile = {\n  entries?: Array<{\n    idx?: number;\n    tag?: string;\n  }>;\n};\n\nfunction migrationNumber(value: string): string | null {\n  const match = value.match(/^(\\d{4})_/);\n  return match ? match[1] : null;\n}\n\nfunction ensureNoDuplicates(values: string[], label: string) {\n  const seen = new Map<string, string>();\n\n  for (const value of values) {\n    const number = migrationNumber(value);\n    if (!number) {\n      throw new Error(`${label} entry does not start with a 4-digit migration number: ${value}`);\n    }\n    const existing = seen.get(number);\n    if (existing) {\n      throw new Error(`Duplicate migration number ${number} in ${label}: ${existing}, ${value}`);\n    }\n    seen.set(number, value);\n  }\n}\n\nfunction ensureStrictlyOrdered(values: string[], label: string) {\n  const sorted = [...values].sort();\n  for (let index = 0; index < values.length; index += 1) {\n    if (values[index] !== sorted[index]) {\n      throw new Error(\n        `${label} are out of order at position ${index}: expected ${sorted[index]}, found ${values[index]}`,\n      );\n    }\n  }","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/db/src/check-migration-numbering.ts#L7-L43","documentation":"Error \"${label} entry does not start with a 4-digit migration number: ${value}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/db/src/check-migration-numbering.ts:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the migration entry so it starts with a 4-digit migration number."],"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"}