{"record":{"id":"dd67e7c623f0f1f7","repo":"paperclipai/paperclip","slug":"deletion-requires-confirm-value-where-value-ma","errorCode":null,"errorMessage":"Deletion requires --confirm <value> where value matches the company ID or issue prefix.","messagePattern":"Deletion requires --confirm <value> where value matches the company ID or issue prefix\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1320,"sourceCode":"    );\n  }\n\n  if (idMatch) return idMatch;\n  if (prefixMatch) return prefixMatch;\n\n  throw new Error(\n    `No company found for selector '${selector}'. Use company ID or issue prefix (for example PAP).`,\n  );\n}\n\nexport function assertDeleteConfirmation(company: Company, opts: CompanyDeleteOptions): void {\n  if (!opts.yes) {\n    throw new Error(\"Deletion requires --yes.\");\n  }\n\n  const confirm = opts.confirm?.trim();\n  if (!confirm) {\n    throw new Error(\n      \"Deletion requires --confirm <value> where value matches the company ID or issue prefix.\",\n    );\n  }\n\n  const confirmsById = confirm === company.id;\n  const confirmsByPrefix = confirm.toUpperCase() === company.issuePrefix.toUpperCase();\n  if (!confirmsById && !confirmsByPrefix) {\n    throw new Error(\n      `Confirmation '${confirm}' does not match target company. Expected ID '${company.id}' or prefix '${company.issuePrefix}'.`,\n    );\n  }\n}\n\nfunction assertDeleteFlags(opts: CompanyDeleteOptions): void {\n  if (!opts.yes) {\n    throw new Error(\"Deletion requires --yes.\");\n  }\n  if (!opts.confirm?.trim()) {","sourceCodeStart":1302,"sourceCodeEnd":1338,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L1302-L1338","documentation":"--yes was passed but --confirm was empty, so assertDeleteConfirmation cannot verify the operator means this specific company; the typed confirmation value is mandatory for company deletion.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:1320 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass --confirm <value> where value is the company ID or its issue prefix."],"exampleFix":null,"handlingStrategy":"validation","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-23T08:17:48.524Z"}